Click here to Skip to main content
14,971,215 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Sir,

In my project i want to control keyboard and mouse of another computer by using my computer's mouse and keyboard in a LAN. Is there any way to do that by using c# coding. So please help me to do that.

Sujith T.P

1 solution

Even though this is a bad idea, certainly there is a way.

You controlled computer should act as a network server, and your controlling computer — as a client, the server performing keyboard and mouse input on its local computer by request from a client.

Therefore, you can develop and install on a server host some Windows Service working as a network service.

For simulation of keyboard and mouse input, use P/Invoked Windows API SendInput:[^].

For networking, you can use sockets, classical remoting or WPF, self-hosted by your Windows Service. Please see my overview of these approaches in my past solutions:
how i can send byte[] to other pc[^],
Communication b/w two Windows applications on LAN.[^].

For development of Windows Service, start here:[^].


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900