在远程计算机中创建会话(Create Session in Remote Computer)

系统教程 行业动态 更新时间:2024-06-14 16:57:18
在远程计算机中创建会话(Create Session in Remote Computer)

我正在尝试使用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.

更多推荐

本文发布于:2023-04-12 20:56:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/da953b3c43d72be2ee54f309750e423b.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:机中   Create   Session   Remote   Computer

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!