C#应用程序访问远程PC文件夹 [英] C# application to access remote PC folder
本文介绍了C#应用程序访问远程PC文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何人都可以帮我开发C#apllication来访问位于另一台具有不同凭据的PC上的文件夹的内容。这两台PC通过LAN连接。所以,我需要一个访问远程PC文件夹的应用程序。
提前谢谢。:)
解决方案
< blockquote>如果通过远程PC文件夹你只是指共享文件夹,对于用户来说它与本地目录没什么区别。你不需要任何应用程序,只需使用 System.IO
编写代码。
另一种选择是在远程主机上安装/运行FTP服务器。对于客户端部分代码,您需要使用的是类 System.Net.FtpWebRequest
:
http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.aspx [ ^ ]。
你必须寻找模仿。参见例如 C#.NET中的完整模拟演示 [ ^ ]示例
Hi,
Can anybody help me out in developing C# apllication to access content of a folder that is residing on another PC with different credential. These two PC''s are Connected through LAN. So, I need an apllication that access a remote PC folder.
Thanks in advance.:)
解决方案
If by "remote PC folder" you simply mean the shared folder, for the user it''s no different from a local directory. You don''t need any "application", you just write the code usingSystem.IO
.
Another option is to install/run an FTP server on a remote host. For a client-part code, all you need to use is the classSystem.Net.FtpWebRequest
:
http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.aspx[^].
—SA
You have to look for "Impersonation". See e.g. A complete Impersonation Demo in C#.NET[^] for an example.
这篇关于C#应用程序访问远程PC文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文