Looking for best practice for doing a “Net Use” in

2020-02-07 00:26发布

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?

标签: c# .net-1.1
2条回答
够拽才男人
2楼-- · 2020-02-07 00:49

Here is an article for using a class for interfacing to the "map network drive" windows interface: C# Map Network Drive (API)

查看更多
叼着烟拽天下
3楼-- · 2020-02-07 01:10

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.

查看更多
登录 后发表回答