Contoh Source Code Membuat Map Network Drive
Option ExplicitPrivate Declare Function WNetAddConnection Lib "mpr.dll" Alias "WNetAddConnectionA" (ByVal lpszNetPath As String, ByVal lpszPassword As String, ByVal lpszLocalName As String) As Long
Private Sub cmdMapDrive_Click()Dim drive_letter As StringDim share_name As StringDim password As String lblResult.Caption = "Working..." Screen.MousePointer = vbHourglass DoEvents drive_letter = txtDriveLetter.Text If InStr(drive_letter, ":") = 0 _ Then drive_letter = drive_letter & ":" share_name = txtShareName.Text password = txtPassword.Text If WNetAddConnection(share_name, password, _ drive_letter) > 0 _ Then lblResult.Caption = "Error mapping drive" Else lblResult.Caption = "Drive mapped" End If Screen.MousePointer = vbDefaultEnd Sub
Demikian dan saya ucapkan terima kasih.
0 komentar:
Komentar Anda
Berikan komentar..