-
Drive Map API call
Anyone familiar with this API call?
Declare Function WNetAddConnection2 Lib "mpr.dll" Alias "WNetAddConnection2A" (lpNetResource As NETRESOURCE, ByVal lpPassword As String, ByVal lpUserName As String, ByVal dwFlags As Long) As Long
Every time I specify username and password, I got an error 1219 - but if dont supply those credentials, it works fine.
Can someone sets some lights on this question?
I also ran into another issue that if a drive is already mapped, my vb exe maps another drive. Say I is mapped, so map J. But when I want to disconnect the drive, I didn't want to disconnect I because it wasn't mapped by my exe. How can I achieve that?
-
Re: Drive Map API call
-
Re: Drive Map API call
I've never used that API before. Here is a VB example on vbnet. The sample doesn't use a password, but does use a username.
It might be helpful to describe what those errors are. Numbers aren't much help
-
Re: Drive Map API call
I think the errors speak for themselves:
ERROR_SESSION_CREDENTIAL_CONFLICT
1219 (0x4C3) Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again.
ERROR_LOGON_FAILURE
1326 (0x52E) Logon failure: unknown user name or bad password.