title: Redirecting standard error out
body: <p>So what i am doing is calling java.exe and making a call to a jar file with some arguments.  If everyting is fine and the command works, then the arguments are printed out to a richtext box.</p>
  
  <p>The issue I am having is when the command isn't correct.  So in once instance, say the user types in the wrong password that's passed into txtPassword.  Stanadard out is not being redirected.  If i run the exact same command in a Dos console, the message "Error: Auth fail", is being presented.  How do i redirect that error to the rich text box?  I thought redirecting stdout would do it, but apparently not. </p>
  
  <p>Any help would be apprecaited.  Please see the code below.</p>
  
  <pre><code>  //Declare and instantiate a new process component.
                  System.Diagnostics.Process process1;
                  process1 = new System.Diagnostics.Process();
                  process1.StartInfo.UseShellExecute = false;
                  process1.StartInfo.RedirectStandardOutput = true;
                  process1.StartInfo.CreateNoWindow = true;
  
                  process1.StartInfo.FileName = "java.exe ";
  
                  toLoad = lstBarToLoad.Items[i].Text;
  
                 process1.StartInfo.Arguments = "-Xmx512M -jar Deploy.jar" + txtPassword;
                 process1.StartInfo.Arguments += toLoad;
  
                Console.WriteLine(process1.StartInfo.Arguments);
  
                process1.Start();
                process1.OutputDataReceived += (s, a) =&gt; myMethod(a);
                process1.BeginOutputReadLine();
  
     //myMthod
       private void myMethod(DataReceivedEventArgs e)
      {
           if (e.Data != null)
          {
              Action action = () =&gt; rchsdtOut.Text += "\r\n" + e.Data.ToString();
              rchsdtOut.BeginInvoke(action, null);
              Console.WriteLine(e.Data.ToString());
          }
      }//end of private
  </code></pre>