VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Connect, Disconnect Networks Drives EASILY

by MASTER VB PROGRAMMER (1 Submission)
Category: Windows System Services
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Date Added: Wed 3rd February 2021
Rating: (101 Votes)

Connects and Disconnects Network Drives from your System

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

Rate Connect, Disconnect Networks Drives EASILY

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

Download this snippet    Add to My Saved Code

Connect, Disconnect Networks Drives EASILY Comments

No comments have been posted about Connect, Disconnect Networks Drives EASILY. Why not be the first to post a comment about Connect, Disconnect Networks Drives EASILY.

Post your comment

Subject:
Message:
0/1000 characters