How do I perform a network login, to access a shared driver for instance, programmatically in c#? The same can be achieved by either attempting to open a share through the explorer, or by the net use shell command.
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
P/Invoke call to WNetAddConnection2 will do the trick. Look here for more info.
You'll need to use Windows Identity Impersonation, take a look at these links http://blogs.msdn.com/shawnfa/archive/2005/03/21/400088.aspx http://blogs.msdn.com/saurabhkv/archive/2008/05/29/windowsidentity-impersonation-using-c-code.aspx