How to map network drive in C#?

G

Guest

hihi
when I am using Platform SDK, I can use WNetAddConnection2 to connect the network drive. But i cannot found these similar function or method in C#. Anyone know C# has this class to do it?

thx...
 
V

Vladimir Scherbina

use P/Invoke

--
Vladimir Scherbina
Ukraine, Kiev.
--

teddy said:
hihi,
when I am using Platform SDK, I can use WNetAddConnection2 to connect the
network drive. But i cannot found these similar function or method in C#.
Anyone know C# has this class to do it??
 
W

Willy Denoyette [MVP]

Don't map network drives, use UNC paths in your C# code, mapping network
drives belongs to the DOS world.

Willy.
 
M

Marc Scheuner [MVP ADSI]

use P/Invoke

Go find the C# statement to use this method using P/Invoke on this
great site:

www.pinvoke.net

Just search for your Win32 API function you're interested in, and
you'll get your answers!

Marc
================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 

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