Check out the formatting tips on the right for help formatting and making links.
Use the template below then delete this header:
// This must be used if NETRESOURCE is defined as a struct
[DllImport("mpr.dll")]    
public static extern int WNetAddConnection3(ref NETRESOURCE netResource,
   string password, string username, int flags);
// This must be used if NETRESOURCE is defined as a class
[DllImport("mpr.dll")]    
public static extern int WNetAddConnection3(NETRESOURCE netResource,
   string password, string username, int flags);
Declare Function WNetAddConnection3 Lib "mpr.dll" (TODO) As TODO
C# Import by Roli.
C# Sample by Roli
Please add some!
C# Sample
NETRESOURCE myNetResource = new NETRESOURCE();        
myNetResource.dwScope = 2;                    
myNetResource.dwType = 1 ;                    
myNetResource.dwDisplayType = 3;            
myNetResource.dwUsage = 1;            
myNetResource.lpLocalName = "z:";        
myNetResource.lpRemoteName = @"\\servername\sharename";        
myNetResource.lpProvider = null;        
int ret = WNetAddConnection3( myNetResource, "password", "username", 0);
/*
  * if username = null the function uses the default user name
  *    (The user context for the process provides the default user name)
  * if password = null the function uses the current default password 
  *    associated with the user specified by the username parameter
  * if password = "" the function does not use a password
  */
TODO
