9

I'd rather not have to resort to calling the command line.
I'm looking for code that can map/disconnect a drive, while also having exception handling.

Any ideas?

Michael Schmidt
  • 9,090
  • 13
  • 56
  • 80
steve_mtl
  • 960
  • 4
  • 12
  • 18

1 Answers1

9

Use P/Invoke and WNetAddConnection2
There should also be some wrappers out there to do some of the grunt work for you.
Google is your friend, as always.

Lars Mæhlum
  • 6,074
  • 3
  • 28
  • 32