VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

This class maps network drives to your PC by UNC name. If it exists then it returns the drive lette

Mark S.  (5 Submissions)   Windows API Call/Explanation   VB 6.0   Unknown Difficulty   Fri 15th February 2002   Mon 8th February 2021

This class maps network drives to your PC by UNC name. If it exists then it returns the drive letter, otherwise it will use the next available

API Declarations


Private Declare Function WNetCancelConnection Lib "mpr.dll" Alias "WNetCancelConnectionA" (ByVal lpszName As String, ByVal bForce As Long) As Long
Private Declare Function WNetGetConnection Lib "mpr.dll" Alias "WNetGetConnectionA" (ByVal lpszLocalName As String, ByVal lpszRemoteName As String, cbRemoteName As Long) As Long

Private Const MAX_VALUE As Integer = 255
Private Const WN_Access_Denied = &H7
Private Const WN_Already_Connected = &H34
Private Const WN_Bad_Localname = &H33
Private Const WN_Bad_NetName = &H32
Private Const WN_Bad_Password = &H6
Private Const WN_Bad_Pointer = &H4
Private Const WN_Net_Error = &H2
Private Const WN_Not_Supported = &H1
Private Const WN_Out_Of_Memory = &HB
Private Const WN_Success = &H0

Private mstrDriveName As String
Private mstrForceLetter As String
Private mstrUNCName As String

Property Let DriveName(ByVal strDriveName As String)

mstrDriveName = strDriveName

End Property

Property Get DriveName() As String

DriveName = mstrDriveName

End Property

Property Let ForceLetter(ByVal strForceLetter As String)

mstrForceLetter = strForceLetter

End Property

Property Get ForceLetter() As String

ForceLetter = mstrForceLetter

End Property

Property Let UNCName(ByVal strUNCName As String)

mstrUNCName = strUNCName

End Property

Property Get UNCName() As String

UNCName = mstrUNCName

End Property

Rate This class maps network drives to your PC by UNC name. If it exists then it returns the drive lette (1(1 Vote))
This class maps network drives to your PC by UNC name. If it exists then it returns the drive lette.bas

This class maps network drives to your PC by UNC name. If it exists then it returns the drive lette Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters