Help View Screen, Control Mouse & Keyboard in .Net Remoting

idan_jl

Member
Joined
Apr 4, 2007
Messages
10
Programming Experience
3-5
Hi! everyone,

I need help on how to view the client window control mouse and keyboard,
I'm trying to make an internet cafe management system, in vb.net I got ideas in remoting but they don't have samples on viewing the window control the mouse and keyboard...
 
Umm.. this wheel was already invented by Microsoft (Remote Desktop, Remote Assistance) and by open source efforts (VNC) from many people and hundreds of hours work..

Are you sure you want to re-invent it?

www.ultravnc.org
 
using VNC service

thanks for the reply, I know there's a VNC and remote desktop, I just want to know the code behind, or is it possible to use the VNC service using your vb.net project? and without using vnc's option like "Disable local inputs, etc." just for viewing only...
 
Maybe you didnt understand what I'm trying to say..

It took many programmers thousands of hours each to create Remote Desktop / UltraVNC

You are one man. It will take you many thousands of hours to create something that already exists..

Just use your VB to launch a few VNCViewer.exe looking at all the relevant client apps. You havent said why youre bothering to do this, but there are better net-nanny solutions than having a person spy on the users full time. It might not even be legal for reasons of privacy.
 
idan_jl, in case you want to try to do this just for learning you should look into smaller bits and start very basic. Don't set off to create application that does everything if you know nothing, one small task at a time, this usually also goes for what you ask from others in return of nothing. Your initial request was using Remoting, there exist numerous tutorials and code examples for this on web. It is not difficult to create a remoting set and test it on local machine to send for example the string "hello remoting". You need a screenshot of desktop, it is easy find and learn many different codes that do this. Combine these two and you are able to get image of remote desktop, send it to client and view it, there you have the little "spy window" ready with little effort.

I have created a basic client-server remoting solution that does it, the solution runs both client and server on local machine now, "localhost" is also the address of the remoting object. It is tested and works in local network by changing the object address to different machine name (for example "tcp://mycomp/..."), of cource the server app must run on other computer too. Consider it a learning project, and you can build further on it. It should not be difficult to understand the code and learn what it does, and in that process perhaps see if there could be options and design tradeoffs. The desktop image is retrieved by click of button, perhaps you want to use a timer to get new image every second or so?

You might notice the mouse cursor is not visible in the screen image? The location is available on remote machine with System.Windows.Forms.Cursor.Position, you can both get and set this value of Point, this info can also be used to draw a cursor image on top of the screen image at correct location. Mouse clicks I think you have to find Win32 pInvoke code. Keyboard presses can be sent with SendKeys class. So here is a number of tips for your further research and development.
 

Attachments

  • vbnet20-tcpremoting.zip
    33.1 KB · Views: 225
thank you to both of you for the reply, thanks to johnh for the sample, by the way the purpose of viewing client is i'm trying to build an internet management system, like cybercafe... anyway thanks alot guys.
 
Hi John Been a long time. I looked at your sample code I am designing a program that will remote to my server(LAN) get an image of the external display and return it to the client. can your code be modified to do that I want to add a time to send the updated image like a RDC viewer.
Thanks Dwain
 
Hi Dwain, been a while, and so has this 10 years old thread :) Since then .Net remoting has been replaced with WCF. You can easily create a new WCF service (or WCF library to use in other server project running with interactive desktop is probably better) with VS and add a method to return an image (as stream). For client you add a service reference and use an instance of that to call the method each time you want the screen image. I recommend you give it a try and create a new thread if you encounter difficulties.
 
Thanks John I didn't realize the thread was so old. I did add a screen capture class to your file which did a nice job of getting the external display. Don't want to rewrite the book. I was trying to use vcnsharp but some suggested using remoting so that's how I found this.
PS your still Da Man:laugh:
 
Back
Top