The WNetAddConnection3 function is similar to the WNetAddConnection2 function. The main difference is that WNetAddConnection3 has an additional parameter, a handle to a window that the provider of network resources can use as an owner window for dialog boxes. The WNetAddConnection2 function and the WNetAddConnection3 function supersede the WNetAddConnection function.
// NETRESOURCE defined as struct
[DllImport("mpr.dll", CharSet=CharSet.Auto, SetLastError=true)]
public static extern int WNetAddConnection3(
[In] IntPtr handleToOwnerWindow,
[In] ref NETRESOURCE netResource,
[In] string password,
[In] string userName,
[In] int flags);
// NETRESOURCE defined as class
[DllImport("mpr.dll", CharSet=CharSet.Auto, SetLastError=true)]
public static extern int WNetAddConnection3(
[In] IntPtr handleToOwnerWindow,
[In] NETRESOURCE netResource,
[In] string password,
[In] string userName,
[In] int flags);
Declare Function WNetAddConnection3 Lib "mpr.dll" (TODO) As TODO
None.
None.
C#
If you define WNetAddConnection3 then the signature for WNetAddConnection2 can be
public static int WNetAddConnection2(
NETRESOURCE netResource,
string password,
string username,
int flags)
{
return(WNetAddConnection3(null, netResource, password, username, flags);
}
Please add some!
TODO