Search The Blog
About this site

Subscribe!

This site aims to connect all the dots of my online activities - from tools, books blogs and twitter accounts, to upcoming conferences, engagements and user group talks.

from 5whys.com
Twitter: @RoyOsherove
My Books

New:

 

The Art of Unit Testing

Buy PDF or Print book at Manning

Buy on Amazon

Latest Posts
« TypeMock Bundled Up with TestDriven.NET | Main | Cool Tool: vRD - Multiple Remote Desktops in one program »
Saturday
Sep092006

How to create your own Auto Login Remote Desktop Application

Speaking of Multiple Remote  Desktops - it's not really that hard to build such an application. Microsoft had a "Microsoft RDP Client Control" ActiveX control that you can use in your apps.

I've even went ahead and implemented a small proof of concept form (you can download it here) that opens a new remote desktop and does an automatic login user your supplied user name and password.

The only "catch" is that the RDP control does not seem to have a method that supplies the user name and password to login - until you dig a little and find out a special interface you need to cast to in order to achieve this functionality (for security reasons, they did not automatically implement that interface on the control - you have to cast to it explicitly).

here's how easy it is to auto login to another machine (note the "clear text" password being sent - there are better ways to do this, but this was the easiest)

rdp.Server = txtComputer.Text;
rdp.UserName = txtUserName.Text;


IMsTscNonScriptable secured = IMsTscNonScriptable)rdp.GetOcx();
secured.ClearTextPassword = txtPassword.Text;


rdp.DesktopHeight = 600;
rdp.DesktopWidth = 800;
rdp.Connect();

Download the full code here.

It was surprisingly easy and reminded me that ActiveX is still a very useful and productive technology which we will all be using for a long time - trash talking it is something which should be done very carefully - this technology enabled real reuse and real "live parts" you can use in windows today and tomorrow.

Trust me when I say you'll be able to write a remote desktop app in Vista in just about the same way I did in 10 minutes - ActiveX.

PrintView Printer Friendly Version

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>
Web Analytics