Click here to Skip to main content
15,881,967 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to implement remote desktop server client using socket programming in c#.
i know basic socket programming in c# but anyone can help me to get controls of mouse and keyboard of remote computer using c# ?
Posted
Comments
Sergey Alexandrovich Kryukov 1-Jan-12 23:58pm    
Do you want to implement your own application-level protocol? Or you want RDP?
--SA
nareshtest0101 2-Jan-12 0:14am    
yes i want to implement my own application-level protocol.
i m ready for r&d if i have to do so..

It is not clear if you want to implement client part only or both server and client. If you want to use existing server part, you have to use RDP, see:
http://en.wikipedia.org/wiki/Remote_Desktop_Protocol[^],
http://msdn.microsoft.com/en-us/library/aa383015.aspx[^],
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q186607[^].

These two CodeProject articles provide the implementations of the client:
Remote Desktop using C#.NET[^],
Palantir - Remote Desktop Manager[^].

—SA
 
Share this answer
 
v2
Comments
nareshtest0101 2-Jan-12 0:08am    
i want to implement both, but i dont want to use RDP is there any other way?
Sergey Alexandrovich Kryukov 2-Jan-12 0:52am    
Of course you can create your own application-level protocol, but what's the problem?
--SA
Sergey Alexandrovich Kryukov 2-Jan-12 1:07am    
This is completely different story. Please use my other answer.
--SA
nareshtest0101 wrote:
I want to implement both, but I don't want to use RDP is there any other way?


Of course you can create your own application-level protocol and implement it in your software. This is not very easy.

First, the adequate form of the server side would be a Windows Service. Start here: http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.100%29.aspx[^].

I would suggest you implement everything using interactive application at first, convert it to a Windows Service after you debug most of the functionality of the server side: debugging of interactive application is much easier.

Some problem is the translation if input sent through the network to actual input on the server side. Use P/Invoked Windows API SendInput (and nothing else; you will really need low-level simulation of input, as it was done through actual hardware and device drivers for mouse/keyboard), see:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms646310%28v=vs.85%29.aspx[^],
http://pinvoke.net/default.aspx/user32.sendinput[^].

If you need to learn P/Invoke, see:
http://en.wikipedia.org/wiki/P/Invoke[^],
http://msdn.microsoft.com/en-us/library/Aa712982[^];
see also this CodeProject article: Essential P/Invoke[^].

You should create an application-level protocol on top of TCP. You can use different levels of networking: from sockets (better in the form of TcpListener/TcpClient) to classical remoting or WCF (in this case, self-hosted by your service). I overview different levels in my past answers:
how i can send byte[] to other pc[^],
Communication b/w two Windows applications on LAN.[^].

—SA
 
Share this answer
 

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