连接到网络驱动器的用户名和密码驱动器、连接到、用户名、密码

2023-09-02 01:40:17 作者:心塞°

我如何提供凭证,这样我可以连接到网络驱动器在.NET?

How do I supply credential so that I can connect to a network drive in .NET?

我想从一个网络驱动器检索文件,并需要提供用户凭据访问驱动器。

I’m trying to retrieve files from a network drive and need to supply user credentials to access the drive.

推荐答案

在一个恒定的痛苦中的 * 的,因为我需要连接到AS / 400,Linux和Solaris网络共享之上的Windows的。

A constant pain in the *, since I need to connect to AS/400, Linux and Solaris network shares over and above Windows ones.

我使用的是Win32 API的封装之一。特别是这个类,它的大多数管道的照顾。

I'm using one of the Win32 API wrappers. Specifically this class that takes care of most of the 'plumbing'.

退房code项目的文章: 连接到具有凭据的UNC路径

Check out the Code Project article: Connect to a UNC Path with Credentials