Here is the function that i have used in C and it should work in VB but I'm not good a translating from C to VB.
The Function is WNetAddConnection2 this allows you to map a drive letter to a shared folder. The definition of this API call is in the Win32 API help file.
Following is the function definition in C for anyone who can translate it:
DWORD WNetAddConnection2(
LPNETRESOURCE lpNetResource, // points to //structure that specifies //connection details
LPCTSTR lpPassword, // points to password string
LPCTSTR lpUsername, // points to user name string
DWORD fdwConnection // set of bit flags that specify // connection options
);
The LPNETRESOURCESTRUCTURE :
typedef struct _NETRESOURCE { // nr
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.