从点对点访问来自互联网的本地文件 [英] Access local files from internet like peer-to-peer

查看:60
本文介绍了从点对点访问来自互联网的本地文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我需要一些指针,我需要创建一个C#应用程序来监视PC中的文件夹并将新文件插入远程网络服务器中的MySQL数据库,棘手的部分是我需要C#应用程序允许PC中的用户从Web服务器访问本地文件夹中的这些文件,以便他们可以打开它们,我们不是在谈论只是将文件传输到Web服务器,只是打开它直接来自本地文件夹,并记住本地PC在路由器后面,所有正常端口都关闭,所以它需要像我认为的点对点连接,但客户端对等体是不是PC是在PHP上运行的网站,不应该要求IIS,但如果需要,我们可以在Windows中创建服务。



这个C#应用程序将运行在系统中一直试着。



这可以创建吗?我看过可以做类似事情的应用程序,但不知道需要什么。



提前致谢。

Hi,
I need some pointers, I'm need to create an C# app that will WATCH a folder in a PC and insert the new files to a MySQL database in a remote webserver, the tricky part is that I need the C# app to allow the user in the PC to access these files in the local folder from the Web server so they can open them, and we are not talking about just transferring the file to the webserver, just open it directly from the local folder, and keeping in mind that the local PC is behind a router, all normal ports are closed, so it will need to be like a peer-to-peer connection I think, but the "client" peer is not a PC is a website running on PHP, IIS should not be required, but we can create services in Windows if they are needed.

This C# app will be running in the system try all the time.

Is this possible to create?, I've seen apps that can do similar things, but don't know what is required.

Thanks in advance.

推荐答案

Web服务器无法访问客户端PC上的文件系统。发送到客户端浏览器的Web PAGES可以访问这些文件,但前提是浏览器的安全设置尽可能低。这不是你在任何公司环境中都会发现的情况。



为了做出类似这样的工作,每个客户端机器都需要成为其他客户端的客户端PC和其他客户端连接的Web服务器。无论如何,要么打开所需的端口,要么不能进行点对点。必须打开哪些端口取决于您在代码中使用的端口。
The web server will not have access to the filesystem on the client PC's. Web PAGES sent to the client browser MAY have access to the files, but only if the security settings on the browsers are set as low as possible. This is not a situation you would find in any corporate environment.

In order to make something like this work, each client machine will need to be both a client to other PC's and a web server for other clients to connect to it. No matter what, either the required ports are opened up, or you can't do peer-to-peer. Which ports must be opened depends on the ports you use in your code.


这篇关于从点对点访问来自互联网的本地文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆