我正在尝试使用FileStream将文件下载到远程计算机。 当我来到FileStream行时,会出现“用户名或密码不正确”等错误。 如何在C#中创建会话或连接远程PC? 如果需要dll,你可以分享吗?
非常感谢
I am trying to download a file to remote computer with FileStream. When i come to FileStream line there is an error occurs like "The user name or password is incorrect.". How can I create session or connect remote pc in C#? If dll is required, can you share it?
Many Thanks
最满意答案
为了能够访问远程文件位置,必须授权您的进程访问该远程资源。 通常,该过程将使用用户启动它的凭据运行,但您可以通过WindowsIdentity.Impersonate方法更改代码中的凭据(例如,使用服务帐户)。
In order to be able to access a remote file location, your process has to be authorized to access that remote resource. Normally the process wil run with the credentials of the user launching it, but you can change the credentials from your code (e.g. to use a service account) by means of the WindowsIdentity.Impersonate method.
更多推荐
发布评论