473,387 Members | 1,440 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Map Drive in VB.NET

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.
Nov 20 '05 #1
2 4732
On Wed, 7 Apr 2004 07:51:11 -0700, "Joe Stanfield" <an*******@discussions.microsoft.com> wrote:

¤ 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 ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Nov 20 '05 #2
On Wed, 7 Apr 2004 07:51:11 -0700, "Joe Stanfield" <an*******@discussions.microsoft.com> wrote:

¤ 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 ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: GregT | last post by:
I program in C#. Is there a way to determine which of the local machine's logical drives are associated with CD drive(s)?
2
by: giloosh99 | last post by:
Hello, Im grabbing tables via VB code using visual foxpro ODBC drives. The tables directory is in a mapped network drive. The code works fine and does the job, however if the computer is idle for...
1
by: Max Baki via .NET 247 | last post by:
I all, i've write a sample ftp Windows service which download files and copy them on remote share or remote mapped drive (the service works fine on local drives). This part of code is the...
7
by: jimdscudder | last post by:
How can I use WMI or a WqlObjectQuery to find the hard drive letter of the physical drive location index. For example the following code will give me the physical drive location:...
5
by: Nirosh | last post by:
Hi All, Can any one suggest me a best way to do this .. I have a thrid party tool "EXE" that we need to use with our web service to manipulate some complex XML files, which reside in a...
3
by: James N | last post by:
My ASP.NET application needs read/write permissions for drive "Z:", which is mapped to my Linksys Gigadrive (Network Attached Storage...if anyone is familiar with that). If I configure the...
2
by: Kavitha | last post by:
Hi , Can any one tel me how to create a virtual drive in C#( similar to Gmail Virtual drive).Also tell me what interfaces could be used to create the same. Thanks in Advance Kavitha
4
by: Luc The Perverse | last post by:
Hi - I have very little C# programming experience. I am making a software product which calls for an interface almost identical to Windows Explorer - and I wondered if mounting a "virtual drive"...
3
by: Killer42 | last post by:
Hi all. Summary Plugging flash drive into work PC, no drive appears. Details First of all, I have searched TheScripts for an answer. The closest I found was this article which covered...
23
by: Rotsey | last post by:
Hi, I am writing an app that scans hard drives and logs info about every fine on the drive. The first iteration of my code used a class and a generic list to store the data and rhis took...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.