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 ’程序中使用方式如下: Private Sub Command1_Click() ’出現 映射網絡磁盤 問話框 ShowMapDrives Me.hwnd End Sub Private Sub Command2_Click() ’出現 中斷網絡磁盤 問話框 ShowUnMapDrives Me.hwnd End Sub |
原文轉自:http://www.anti-gravitydesign.com