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

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

问题描述:

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.

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.

Any help would be greatly appreciated, thanks!

我正在寻找创建一个(很可能是php)Web服务器,用户可以登录并发送消息 互联网连接到家用电脑上用户任务栏中运行的C#应用​​程序,并显示一条消息。 p>

LogMeIn和Dropbox似乎都将数据“推送”到用户的电脑上,无需任何需要 信息(没有桌面端的静态IP地址)所以它必须是可能的,但我不确定如何。 p>

任何帮助将不胜感激,谢谢! p> DIV>

The way I would do it is to have the C# desktop application act as a server and listen to socket connections. The PHP application could then connect on requests, send the required data then close the connection.

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. 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. The PHP script could then fetch that to connect.

After you start for example LogMeIn, it will open a port and send his IP to the LogMeIn server. He will do does every X minutes/hours. If the LogMeIn server has a request for your client, it will send an request to your IP on the specific port.

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. Otherwise just a simple reply the server received it.

  1. Client Application updates a centralized database with it's IP address when it turns on. 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).
  2. Client Application exposes a service endpoint (WCF/SOAP would be easy), that performs some job (such as displaying a message box)
  3. Your server sends SOAP Messages to the client application. SOAP is essentially XML, so you could have PHP do this fairly easily.

How you perform the client/server communication is up to you. WCF/SOAP is just one approach, but it is extremely easy. 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.

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,

Then i can open my webpage from anywhere, and i will have a WEB BASE REMOTE DESKTOP CONNECTION.

so far i have reached here 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. which is way beyond BAD.