title: open command prompt through Visual studio ( C# ) , run some commands and then display the resultant details in the command prompt through a text box
body: <p>This is the program I wrote to open cmd, run IPERF as a <strong>client</strong>.
  After connecting with the server, it is supposed to show the bandwidth of the network.
  But the command prompt closes and the information I require is only available at the server side.</p>
  
  <p>How do I get the information and display it in a MessageBox ? </p>
  
  <p>Any form of assistance is most appreciated.</p>
  
  <pre><code>string output;
  ProcessStartInfo start = new ProcessStartInfo(@"C:\Windows\System32\cmd.exe");
  start.UseShellExecute = false;
  start.ErrorDialog = false;
  start.WindowStyle = ProcessWindowStyle.Normal;
  start.RedirectStandardError = true;
  start.RedirectStandardInput = true;
  start.RedirectStandardOutput = true;
  Process cmd = new Process();
  cmd.StartInfo = start;
  cmd.Start();
  try
  {
    Process.Start("cmd", "/C iperf -c " + IP_Address);
  }
  catch
  {
  }
  Thread.Sleep(1000);
  StreamReader outputReader = cmd.StandardOutput;
  StreamReader errorReader = cmd.StandardError;         
  output = outputReader.ReadToEnd();
  MessageBox.Show( output );
  </code></pre>