Map Drive in VB.NET

G

Guest

Hello
How do I bring up the standard "Map Network Drive" dialog box using VB .NET
I've seen posts that describe how to map a drive (either via API or via the 'net use' command), but I want my program to bring up the system's default "Map Network Drive" dialog box (that the user would see if they clicked "Tools/Map Network Drive" in Explorer)

Thanks in advance for your guidance
Joe.
 
P

Paul Clement

¤ Hello.
¤ How do I bring up the standard "Map Network Drive" dialog box using VB .NET?
¤ I've seen posts that describe how to map a drive (either via API or via the 'net use' command), but I want my program to bring up the system's default "Map Network Drive" dialog box (that the user would see if they clicked "Tools/Map Network Drive" in Explorer).
¤
¤ Thanks in advance for your guidance.
¤ Joe.


Private Declare Function WNetConnectionDialog Lib "mpr.dll" (ByVal hwnd As Integer, ByVal dwType
As Integer) As Integer

Public Sub DisplayMapDriveDialog()

Dim ReturnValue As Integer
Const RESOURCETYPE_DISK = &H1

ReturnValue = WNetConnectionDialog(Nothing, RESOURCETYPE_DISK)

End Sub


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top