Register/map network drive using managed code?

J

JDeats

Is it possible to have a .NET Application register a network drive map
(e.g. Z: \\server1\myfolder)? If so could someone post a code sample?

-Jeremy
 
N

Nicholas Paldino [.NET/C# MVP]

Jeremy,

You will want to make a call to the WNetAddConnection (or
WNetAddConnection2 or WNetAddConnection3). You will have to do this through
the P/Invoke layer, but the call is to the same API you would use in C++.

Hope this helps.
 

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