Search Tools Links Login

Connect to a remote share AUTOMATICALLY, with NO user input.


Ive seen a lot of source code that can bring up the window asking the user to connect to a remote share, but none of which would work without user input. This API call (WNetAddConnection) is very easy and simple to use, altho i cant guarrentee it will work on 98/ME.... tHe_cLeanER

Original Author: tHe_cLeanER

Code

Option Explicit
Private Declare Function WNetAddConnection Lib "mpr.dll" Alias "WNetAddConnectionA" (ByVal lpszNetPath As String, ByVal lpszPassword As String, ByVal lpszLocalName As String) As Long
Private Sub Form_Load()
Dim r As Long
r = WNetAddConnection("\dedicatedxpserver", vbNullString, "x:")
If r <> 0 Then
MsgBox "ERROR: " & Err.Description
End If
End Sub

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 92 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.