在C#中,即使用户无权访问物理服务器,如何打开文件?
如何打开文件,任何文件,例如来自另一台机器的txt文件,即使打开该文件的用户也无权访问该文件实际存储的机器?
我想创建一个应用程序,它将显示存储在另一台计算机上的文件列表,并且任何有权访问我的应用程序的人都可以通过我的应用程序访问这些文件,然后用户可以从他/她的一侧打开该文件。
非常感谢
PlayKid
How do I open a file, any file, like txt file from another machine, even the user who is opening the file do not have right to access to the machine where the file actually store?
I would like to create an application who will show a list of files which stores on another machine, and those files can be access by whoever have access to my application, via my application, the usr can then open the file from his/her side.
Thanks alot
PlayKid
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以执行代码将在有权访问该文件的帐户下获取远程文件。这涉及将帐户的用户名/密码存储在您的应用程序中,但这可能是一个安全问题。
如果这是一个 ASP.NET 应用程序,您可以向执行该应用程序的帐户授予足够的权限,以便访问远程资源。
You could execute the code that will fetch the remote file under an account that will have access to this file. This involves storing the username/password of the account in your application though which could be a security issue.
If this is an ASP.NET application you could grant permissions to the account executing this application sufficient permissions in order to access the remote resource.
如果由于网络共享限制(如域规则)而无法访问另一台计算机,那么可能不是这样。
但是,如果您有权在另一台计算机上安装应用程序,那么您基本上需要的是文件共享应用程序。
然而,这太多了,无法解释,应该用谷歌搜索。
If you cannot access the other computer because of network sharing restrictions (like domain rules) then probably not in that way.
But if you have access to install applications to the other computer what you basically want is a file sharing application.
That however is too much to explain and should be googled about.