下面的程序段可以模拟及中的,就是出现的问话框,让使用者根据自己电脑的情形,来决定要连接的网络磁盘要映射到自己的那一个磁盘?要中断的又是那一个对应的磁盘?
请在声明区中加入以下声明及模组:
Private Declare Function WNetConnectionDialog Lib "mpr.dll" _
(ByVal hwnd As Long, ByVal dwType As Long) As Long
Private Declare Function WNetDisconnectDialog Lib "mpr.dll" _
(ByVal hwnd As Long, ByVal dwType As Long) As Long
Sub ShowMapDrives(hwnd As Long)
WNetConnectionDialog hwnd, 1
End Sub
Sub ShowUnMapDrives(hwnd As Long)
WNetDisconnectDialog hwnd, 1
End Sub
'程序中使用方式...[ 查看全文 ]