寻找最佳实践做一个"网络使用"在C#中 [英] Looking for best practice for doing a "Net Use" in C#
本文介绍了寻找最佳实践做一个"网络使用"在C#中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我宁愿没有求助于调用命令行。结果
我在寻找的代码,可以映射/断开驱动器,同时也有例外处理。
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.
任何想法
推荐答案
使用的P / Invoke和的WNetAddConnection2
也应该有一定的wrappers 的在那里做一些繁重的工作适合你。
谷歌是你朋友,一如既往。
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.
这篇关于寻找最佳实践做一个"网络使用"在C#中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文