简体   繁体   中英

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.

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!

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.

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.

  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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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