You can use WNetAddConnection2 - you will need to use Christof Lange's struct class to deal with this as it requires a structure as it's first paramter.
Usage is as follows:
DWORD WNetAddConnection2( lpNetResource, lpPassword, lpUsername, fdwConnection)
lpUserName and lpPassword are both strings.
lpNetResource is a structure of resource information.
fdwConnection is a set of bit flags for connection options.
If you need further info, I may be able to eMail you the pages from the Win32API help file.
>I am looking for a solution to connect the current Nt domain with a different user using API call from VFP program, is it possible that i change the user.
>
>I have created a user account on NT for amy application and want to control the program assess only from that user and i don't want to tell the user about the user's password and the user's name,
>
>is there any sloution
>
>
>thanks in advance