|
-
May 26th, 2011, 04:16 PM
#1
Thread Starter
Frenzied Member
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?
-
May 26th, 2011, 05:02 PM
#2
Thread Starter
Frenzied Member
-
May 26th, 2011, 09:32 PM
#3
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
-
May 28th, 2011, 02:14 AM
#4
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|