title: c# execute shell command and get result
body: <p>I am executing a command prompt command as follows:</p>
  
  <pre><code>string cmd = "/c dir" ; 
  System.Diagnostics.Process proc = new System.Diagnostics.Process(); 
  proc.StartInfo.FileName = "cmd.exe";
  proc.StartInfo.Arguments = cmd; 
  proc.StartInfo.UseShellExecute = false;
  proc.StartInfo.RedirectStandardOutput = true; 
  proc.Start();
  </code></pre>
  
  <p>How to I get the output of the command?</p>