简体   繁体   English

从网站远程启动桌面应用程序

[英]Remotely launching a desktop application from a web site

I'm looking to create a (most likely php) web server where a user can log in and send messages over the internet to a C# application that is running in the user's taskbar on their home pc and display a message. 我正在寻找一个(最有可能的php)Web服务器,用户可以在其中登录并通过Internet将消息发送到在其家用PC上的用户任务栏中运行的C#应用​​程序并显示消息。

LogMeIn and Dropbox both seem to "push" data to the user's pc without any needed information (no static ip address for the desktop side) so it must be possible but I'm not sure how. LogMeIn和Dropbox似乎都将数据“推送”到用户的PC上,而没有任何必要的信息(台式机端没有静态IP地址),因此这一定有可能,但我不确定如何做到。

Any help would be greatly appreciated, thanks! 任何帮助将不胜感激,谢谢!

After you start for example LogMeIn, it will open a port and send his IP to the LogMeIn server. 例如,在启动LogMeIn之后,它将打开一个端口并将其IP发送到LogMeIn服务器。 He will do does every X minutes/hours. 他将每隔X分钟/小时执行一次。 If the LogMeIn server has a request for your client, it will send an request to your IP on the specific port. 如果LogMeIn服务器对您的客户端有请求,它将向特定端口上的IP发送一个请求。

I guess 我猜

It's also possible to poll the whole time from the client PC, send a packet to the server, if the server has something, return a special packet. 还可以从客户端PC轮询整个时间,将数据包发送到服务器,如果服务器有东西,则返回一个特殊的数据包。 Otherwise just a simple reply the server received it. 否则,服务器会收到一个简单的回复。

The way I would do it is to have the C# desktop application act as a server and listen to socket connections. 我要做的方法是让C#桌面应用程序充当服务器并侦听套接字连接。 The PHP application could then connect on requests, send the required data then close the connection. 然后,PHP应用程序可以根据请求进行连接,发送所需的数据,然后关闭连接。

The only way to connect to another computer is to use some kind of address. 连接到另一台计算机的唯一方法是使用某种地址。 These services probably have a central database of current user IPs. 这些服务可能具有当前用户IP的中央数据库。 In your case, your C# application would know the "username" of the computer it's on and every time it is started it could go update a field in a database with the current external IP. 在您的情况下,您的C#应用​​程序将知道它所在的计算机的“用户名”,并且每次启动时都可以使用当前的外部IP更新数据库中的字段。 The PHP script could then fetch that to connect. 然后,PHP脚本可以获取该内容以进行连接。

  1. Client Application updates a centralized database with it's IP address when it turns on. 客户端应用程序在打开时使用其IP地址更新集中式数据库。 Best approach may be to update the value on a hook whenever the Client Application gains an internet connection (as that is when the IP will change). 最好的方法可能是每当客户端应用程序获得Internet连接时(即IP更改时)更新挂接上的值。
  2. Client Application exposes a service endpoint (WCF/SOAP would be easy), that performs some job (such as displaying a message box) 客户端应用程序公开一个服务端点(WCF / SOAP会很容易),该端点执行一些工作(例如显示消息框)
  3. Your server sends SOAP Messages to the client application. 您的服务器将SOAP消息发送到客户端应用程序。 SOAP is essentially XML, so you could have PHP do this fairly easily. SOAP本质上是XML,因此您可以让PHP相当容易地做到这一点。

How you perform the client/server communication is up to you. 如何执行客户端/服务器通信取决于您。 WCF/SOAP is just one approach, but it is extremely easy. WCF / SOAP只是一种方法,但是非常简单。 You probably want to use some kind of service endpoint framework to avoid writing all the plumbing yourself (no need to reinvent the wheel). 您可能希望使用某种服务端点框架来避免自己编写所有管道(无需重新发明轮子)。 WCF services can be run without IIS installed as well. WCF服务也可以在不安装IIS的情况下运行。

how far have you gotten with this. 你走了多远。 I was trying to do the same thing. 我试图做同样的事情。

My idea was i would have C# App\\Service which will keep taking continuous screen-shots of my desktop and keep sending them to a web-server which i have, There on the web-server after log-in authentication, web login not desktop, i will show the streaming desktop on web-page and will keep sending the mouse location and clicks & right clicks to the db which again my C# App\\Service will be constantly monitoring, and will interpret those mouse movements and clicks and PLAY THEM\\PERFORM them on my desktop PC by having a INPUT HOOK or some-thing, 我的想法是,我将拥有C#App \\ Service,它将持续拍摄我的桌面的连续屏幕截图,并将其继续发送到我拥有的Web服务器,登录身份验证后在Web服务器上存在,Web登录不是桌面,我将在网页上显示流式桌面,并继续将鼠标位置,单击和右键单击发送到数据库,该数据库将再次监视我的C#App \\ Service,并解释这些鼠标的移动和单击以及“播放” \\通过输入钩或其他东西在我的台式机上执行它们,

Then i can open my webpage from anywhere, and i will have a WEB BASE REMOTE DESKTOP CONNECTION. 然后,我可以从任何地方打开我的网页,并且我将拥有一个基于Web的远程桌面连接。

so far i have reached here http://moon.pk/sad/ 到目前为止,我已经到达这里http://moon.pk/sad/

i am sending captured screen-shots to MySQL DB of my webserver which is taking more than one minute to transfer, so frame rate will be 0.75 fps. 我正在将捕获的屏幕快照发送到我的Web服务器的MySQL DB,这需要花费一分钟以上的时间来传输,因此帧速率将为0.75 fps。 which is way beyond BAD. 这远远超出了BAD。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM