Results 1 to 10 of 10

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

  1. #1
    idan_jl is offline VB.NET Forum Newbie
    .NET Framework
    .NET 2.0 (VS 2005)
    Join Date
    Apr 2007
    Posts
    10
    Reputation
    125

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

    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...

  2. #2
    cjard's Avatar
    cjard is offline VB.NET Forum All-Mighty
    .NET Framework
    .NET 4.0
    Join Date
    Apr 2006
    Posts
    7,041
    Reputation
    1752
    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

  3. #3
    idan_jl is offline VB.NET Forum Newbie
    .NET Framework
    .NET 2.0 (VS 2005)
    Join Date
    Apr 2007
    Posts
    10
    Reputation
    125

    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...

  4. #4
    cjard's Avatar
    cjard is offline VB.NET Forum All-Mighty
    .NET Framework
    .NET 4.0
    Join Date
    Apr 2006
    Posts
    7,041
    Reputation
    1752
    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.

  5. #5
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.5
    Join Date
    Dec 2005
    Location
    Norway
    Posts
    15,090
    Reputation
    2804
    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.
    Attached Files Attached Files
    How to format posts with code blocks etc - present the problem/post properly

    Visual Studio Community 2017

  6. #6
    idan_jl is offline VB.NET Forum Newbie
    .NET Framework
    .NET 2.0 (VS 2005)
    Join Date
    Apr 2007
    Posts
    10
    Reputation
    125
    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.

  7. #7
    dwains is offline VB.NET Forum Newbie
    .NET Framework
    .NET 4.5
    Join Date
    Feb 2016
    Posts
    14
    Reputation
    17
    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

  8. #8
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.5
    Join Date
    Dec 2005
    Location
    Norway
    Posts
    15,090
    Reputation
    2804
    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.
    How to format posts with code blocks etc - present the problem/post properly

    Visual Studio Community 2017

  9. #9
    dwains is offline VB.NET Forum Newbie
    .NET Framework
    .NET 4.5
    Join Date
    Feb 2016
    Posts
    14
    Reputation
    17
    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

  10. #10
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.5
    Join Date
    Dec 2005
    Location
    Norway
    Posts
    15,090
    Reputation
    2804
    Updated the sample to WCF technology and posted here: WCF service library in self-hosted console server, and test client
    Hope this helps you and others too
    How to format posts with code blocks etc - present the problem/post properly

    Visual Studio Community 2017

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •