5

I would like to figure out how to create a C# Remote Desktop client and the documentation on the internet varies from sparse to non-existent. Or if you have this information, please let me know. I will compile as much info as possible and post it up somewhere

I'd like to learn the following information:

  1. How do I connect programatically to a remote desktop server? What client class should I use? There are like 20 of them.
  2. I sort of know that you can set Server and Username directly. How do I set the password securely?
  3. Why doesn't the following code work?

    MsRdpClient7 rdc = new MSTSCLib.MsRdpClient7();
    rdc.Server = "fake.bogus.com";
    rdc.UserName = "JChen";
    rdc.AdvancedSettings2.ClearTextPassword = "insecure";
    rdc.Connect();
    
  4. What is the full API for the RDP client? What kinds of information can I get from it?

If you've been working with RDP in C#, please help. You'll be providing a huge service to all the people who need to learn this API and more importantly, to me :-)

Thanks again!
Jieren

EDIT: To clarify a bit, I'm trying to create a console RDP client that can both send data to and receive data from the RDP server. I've already done a Forms RDP client using the AxMsTscAxNotSafeForScripting type.

Jieren
  • 1,952
  • 4
  • 18
  • 26
  • Hi, i am looking at the same problem. Have you found a way to transfer local data over to the RDP server? I cant find useful api doc as well... Hope u can point me to something better.. – flyclassic Jul 21 '11 at 09:26
  • try that: [http://stackoverflow.com/questions/23545717/c-sharp-remote-desktop-application-using-rdp-how-to-generate-the-certificate/23752150#23752150] – Ronaldo Veronesi Dec 18 '15 at 18:28

2 Answers2

6

MSDN has documentation for the Remote Desktop ActiveX Control Interface

(What a long and descriptive name :) )

Onkelborg
  • 3,927
  • 1
  • 19
  • 22
  • 1
    Thanks for the quick response! I did check out this documentation, but it only has information on the remote desktop protocol interfaces. I'd like to learn more about the a teal implementation classes and which ones I should use. Thanks again for your help though! – Jieren Oct 23 '10 at 16:41
  • @Jieren: I don't know what kind of documentation you want, but that's what I've used previously. The version number one the interfaces are for providing backward compability, the higher, the newer (and supports more stuff.) It's MsRdpClient7 you should use. #3: What doesn't work? What's happening? What do you expect to happen? – Onkelborg Oct 23 '10 at 17:12
  • 1
    for #3 I test whether or not I'm connected with Console.WriteLine(rdc.Connected); and then I rdc.Disconnect(); I get a 0 for rdc.Connected and rdc.Disconnect() throws an exception since I'm not connected in the first place. – Jieren Oct 24 '10 at 13:09
  • Hm, I don't think that Connect is a blocking call. You should subscribe to the events to know when you are connected/something errors out – Onkelborg Oct 24 '10 at 19:35
0

The documentation for the advanced settings can be found here: IMsRdpClientAdvancedSettings interface

An extensive implementation of RDP is available on github (RemoteNG on github). Looking there is probably the best way to solve own implementation problems. Because mRemote is an implementation for several protocols (RDP, VNC, Citrix and others) it takes some time to understand what they are doing.

enter image description here

Another, simplier implementation can be found here: Mulit RDP client .NET. The disadvantage is that this solution is over 10 years old, so a fairly old version of the OCX is implemented there. The big advantage is that, unlike mRemote, this code is not published under the GPL.

enter image description here

marsh-wiggle
  • 2,508
  • 3
  • 35
  • 52