Hey all!
I searched this forum for related topic but found none. So here is my query.
I have to create a Remote desktop application (yes, something similar to LogMeIn Remote Desktop.) but over lan.
I dont know how the commercially available application do it as the lag is very less & it seems very much real time.
My idea is based on taking screen shots of the remote computer and send it to the computer monitoring it. Send the mouse location, clicks and keyboard presses from the monitoring pc to the remote computer.
I think this can be done using Serialization and .NET Remoting layer. And i thought of using C# for code development.I am currently studying more about it. But it would be nice if i got inputs from someone as to how to proceed. I dont want to walk down the wrong road(.NET Remoting) as i dont have a lot of time.
any input and help will be greatly appreciated.
Thanks in advance!!!
Comments
2. No, you dont need to know windows system programming. What you should know is object oriented programming.
Normally you would need to know that BUT check this out:
http://www.codeproject.com/KB/cs/globalhook.aspx
I havent had time to go through the code but i think that author has found a way to monitor mouse and keyboard activities using .NET! This will be VERY useful on the client side. BUT, on the server side you MAY need to use system programming(at least for my project since i have to forcefully move the mouse pointer to the desired location, thats the whole concept of remote desktop, controlling a remote pc). Well, you have a solution for monitoring, just need a solution for controlling!
I'll be happy to answer any other queries you have.
It's not as simple as spamming screenshots across a TCP or UDP channel to the monitoring client. If the server has a 1280 x 1024 size monitor, you'll be transferring 1,310,720 bytes (with the header and overhead) as fast as possible each second - impractical and ineffecient. If you want near-realtime screen updates, a mirror driver would be the best solution. A mirror driver works at a very low-level, notifying your application of any screen changes (this is exactly what UltraVNC uses as described on their homepage). The mirror driver in question is called DF Mirage Mirror Driver, except it seems to be written in C and I don't know how to use it in C#. Not to discourage you, but you need to find a more efficient method than rapidly sending full size screenshots across the channel.
I would suggest sending only the changed portions of the screen. You could make a custom Pixel class with two fields - location, and color. You can make a custom Picture class which contains a 2-dimensional array of Pixel. However, when I tried this, serialization and compression literally took 40 seconds each with my program memory usage shooting beyond 300K. If you can think of a solution, don't forget to post it here for everybody's benefit!
Yeah, sending whole screen shots is very inefficient and it wastes a lot of bandwidth. Sending only the changed part of the screen is a better option and i have to implement it soon.
My progress till now: What i have done is very little. I have written code to take screen shot, save it into memory stream using .png format, convert it into byte array and transfer it over the network, reconstruct the image and display it on a form. I have made the thread which makes the remote calls for the screen shot sleep for 500ms b/w each call and the lag is very little.
Could be kind enough to tell a bit about your implementation like what language you are using, what features you have provided and what features you intend to provide? What are you doing about the mouse and the keyboard?
I have specified a url to a page which uses global hooks to monitor the mouse and keyboard and that is what i plan on using.
I have 1 and a half months to complete this project and i dont know if that is enough...