A set of software is developed for the customer and deployed on the customer's server. Remote control is enabled to facilitate maintenance. However, the customer uses a China Unicom network, the company uses a telecom network, and remote control is slow. Therefore, we consider how to reduce network traffic and reduce the screen resolution and color of remote servers, however, the operation is still very slow.
Generally, you do not need to refresh the screen in real time. You only need to click the mouse or enter characters to obtain the latest screen image. Therefore, you have written a remote control software based on this idea.
Key Technology: Control Mode:
Use B/S to directly access the client using IE.
The server directly receives commands through the HTTP protocol. After searching, net directly provides httplistener for processing HTTP Communication.
Simulate mouse operation:
Directly call the API: mouse_event. There are many introductions on the Internet. I have used it in other projects and used the existing files directly.
Simulate keyboard operation:
. Net directly has the sendkeys sending button, which can be processed by special buttons.
Get screen:
After searching on the Internet, you can directly useCode.
The above content is pieced together, and the software is complete. Actually used, the effect is good.
Usage:
Copy the compiled httpserver.exem and screen.htm files to the server and run them.
The default port is 9999. You can also keep up with the port number after the executable file.
The client can use the IP address and corresponding port of the IE Service server, for example, "http: // 127.0.0.1: 9999 /"
Mouse control: Click the image directly.
Keyboard Control: Enter the keyboard command in the text box and send it.
The example in the figure is: 1 Press ENTER 2tab key 2.1, and then execute the Select All operation (CTRL + a). For specific special keys, see sendkeys help.
Note:
You must log on remotely to obtain images and execute commands. (It must be used together with remote control and other software, and cannot be used independently .)
You can modify the screen.htm file and convert some common mouse and keyboard operations into scripts for one-click execution, such as automatic login software.
Attachment download:
Source code and executable files:/files/Pharaoh/httpserver.zip
The source code is in vs2008 format.