Exemple #1
0
 public void ConnectTo(System.Diagnostics.Process process)
 {
     process.BeginOutputReadLine();
     process.BeginErrorReadLine();
     process.OutputDataReceived += OnOut;
     process.ErrorDataReceived += OnErr;
 }
Exemple #2
0
            public ConsoleDataHandler(System.Diagnostics.Process p)
            {
                p.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(HandleOutputDataReceived);
                p.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(HandleErrorDataReceived);

                p.BeginErrorReadLine();
                p.BeginOutputReadLine();
            }