Mapping a Drive

J

John Smith

Hello all:

Is there a way to map a drive programatically in .NET?

Thanks,

- John -
 
W

Willy Denoyette [MVP]

Nothing included in the FCL to do this, so you will have to PInvoke
NetUseAdd (netapi32.dll ) orWNetAddConnection2 or WNetAddConnection3 (
mpr.dll ).
Another option in to call the "net use add ..." shell command using
System.Diagnostics Process.Start method.
However I suggest using UNC path's instead of mapping drives to local
devices.

Willy.
 

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