title: Remote Desktop Connection with MSTSCLib
body: <p>I'm trying to code a Remote Desktop Application using C# .NET.</p>
  
  <p>I followed some examples (listed below) and created a Windows Form, added references to MSTSLib, added Microsoft Terminal Service Control to the Form and code the following behavior:</p>
  
  <pre><code>namespace RDConnector
  {
      public partial class Form1 : Form
      {    
          const string server = "55.55.55.555";
          const string userNameBase = "username";
          const string passwordBase = "password";
  
          public Form1()
          {
              InitializeComponent();
          }
  
          private void button1_Click(object sender, EventArgs e)
          {
              try
              {
                  rdClient.Server = server;
                  rdClient.UserName = userNameBase;    
  
                  /*IMsTscNonScriptable secured = (IMsTscNonScriptable)rdClient.GetOcx();
                  secured.ClearTextPassword = passwordBase;*/
  
                  rdClient.AdvancedSettings8.DisplayConnectionBar = true;
                  rdClient.AdvancedSettings8.ClearTextPassword = passwordBase;
                  rdClient.AdvancedSettings8.EncryptionEnabled = -1;                 
  
                  //// Start connection
                  rdClient.Connect();
                  MessageBox.Show("Connection Status + " + rdClient.Connected.ToString());
  
              }
              catch (Exception Ex)
              {
                  MessageBox.Show("Exception ocurred: " + Ex.Message);
              }
          }
      }
  }
  </code></pre>
  
  <p>However, it isn't working, the Connection status after calling <code>rdClient.Connect()</code> is 2 (0 before calling it), but nothing happens. I also ran the Example 1 and it doesn't work. </p>
  
  <p>I'm using Windows 7 - 64 bit and Visual Studio C# Express. Visual Express Edition doesn't have a X64 compiler, Could be the problem related with that?</p>
  
  <p>I'll really appreciate your help.</p>
  
  <p>Examples:</p>
  
  <ol>
  <li><p><a href="http://www.codeproject.com/KB/cs/RemoteDesktop_CSharpNET.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/cs/RemoteDesktop_CSharpNET.aspx</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/7198725/running-com-component-controls-on-multiple-threads">Running COM component controls on multiple threads</a></p></li>
  </ol>