title: How to run commands on SSH server in C#?
body: <p>I need to execute this action using a C# code:</p>
  
  <ol>
  <li>open putty.exe in the background (this is like a cmd window)</li>
  <li>login to a remote host using its IP address</li>
  <li>enter a user name and password</li>
  <li>execute several commands one after the other.</li>
  <li>run another command that gets a response telling me that the commands I ran before that where executed successfully</li>
  </ol>
  
  <p>So I'm trying to do it like this:</p>
  
  <pre><code>ProcessStartInfo proc = new ProcessStartInfo() 
  {
       FileName = @"C:\putty.exe",
       UseShellExecute = true, //I think I need to use shell execute ?
       RedirectStandardInput = false,
       RedirectStandardOutput = false,
       Arguments = string.Format("-ssh {0}@{1} 22 -pw {2}", userName, hostIP, password)
       ... //How do I send commands to be executed here ?
  };
  Process.Start(proc);
  </code></pre>