G
Gee
Hi
Can anyone help me convert this to C# please?
Structure NETRESOURCE
Public dwScope As Int32
Public dwType As Int32
Public dwDisplayType As Int32
Public dwUsage As Int32
Public lpLocalName As String
Public lpRemoteName As String
Public lpComment As String
Public lpProvider As String
End Structure
'
Public Const NO_ERROR As Int32 = 0
Public Const CONNECT_UPDATE_PROFILE As Int32 = &H1
Public Const RESOURCETYPE_DISK As Int32 = &H1
'
Declare Function WNetAddConnection2 Lib "mpr.dll" Alias _
"WNetAddConnection2A" (ByRef lpNetResource As NETRESOURCE, _
<MarshalAs(UnmanagedType.LPStr)> ByVal lpPassword As String, _
<MarshalAs(UnmanagedType.LPStr)> ByVal lpUserName As String, _
ByVal dwFlags As Int32) As Int32
'
Declare Function WNetCancelConnection2 Lib "mpr.dll" Alias _
"WNetCancelConnection2A" (ByVal lpName As String, _
ByVal dwFlags As Long, ByVal fForce As Long) As Long
Thanks,
-Gee.
Can anyone help me convert this to C# please?
Structure NETRESOURCE
Public dwScope As Int32
Public dwType As Int32
Public dwDisplayType As Int32
Public dwUsage As Int32
Public lpLocalName As String
Public lpRemoteName As String
Public lpComment As String
Public lpProvider As String
End Structure
'
Public Const NO_ERROR As Int32 = 0
Public Const CONNECT_UPDATE_PROFILE As Int32 = &H1
Public Const RESOURCETYPE_DISK As Int32 = &H1
'
Declare Function WNetAddConnection2 Lib "mpr.dll" Alias _
"WNetAddConnection2A" (ByRef lpNetResource As NETRESOURCE, _
<MarshalAs(UnmanagedType.LPStr)> ByVal lpPassword As String, _
<MarshalAs(UnmanagedType.LPStr)> ByVal lpUserName As String, _
ByVal dwFlags As Int32) As Int32
'
Declare Function WNetCancelConnection2 Lib "mpr.dll" Alias _
"WNetCancelConnection2A" (ByVal lpName As String, _
ByVal dwFlags As Long, ByVal fForce As Long) As Long
Thanks,
-Gee.