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