title: Check if the user and the password of a remote desktop are correct using c#
body: <p>Please I need help about how I can check if the user and the password are correct when login in a remote desktop.
  I have already write this code to connect but what I really need it's just <strong>check</strong> if the login is <strong>correct</strong>.</p>
  
  <p>This is my method:</p>
  
  <p>I'm Using <strong>MSTSC Lib</strong> </p>
  
  <pre><code>public void test(string sr, string us, string pwd)
  {   
      rdp.Server = sr;
      rdp.UserName = us;
      IMsTscNonScriptable secured = (IMsTscNonScriptable)rdp.GetOcx();
      secured.ClearTextPassword = pwd;
      rdp.Connect(); 
  
      MessageBox.Show(rdp.Connected.ToString());
  }
  </code></pre>
  
  <p>Thanks for your help in advance </p>