Connect, Disconnect Networks Drives ( EASILY )

By | 2002-06-01

Connects and Disconnects Network Drives from your System

Original Author: MASTER VB PROGRAMMER

API Declarations

Declare Function WNetConnectionDialog Lib “mpr.dll” (ByVal hwnd As Long, ByVal dwType As Long) As Long
Declare Function WNetDisconnectDialog Lib “mpr.dll” (ByVal hwnd As Long, ByVal dwType As Long) As Long
Public Const RESOURCETYPE_DISK = &H1

Code

Private Sub cmdConnect_Click()
Dim x As Long
If Index = 0 Then
x = WNetConnectionDialog(Me.hwnd, RESOURCETYPE_DISK)
End If
End Sub
Private Sub cmdDisconnect_Click()
If Index = 1 Then
x = WNetDisconnectDialog(Me.hwnd, RESOURCETYPE_DISK)
End If
End Sub

Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.