Can I get output of existing proccess? When I'm trying it says process is not running or doesn't have output redirect. Example I launched ping google.com -t (waited 20 seconds to have ouput) and I want last 10 lines from it:
var processes = Process.GetProcessesByName("PING").FirstOrDefault();
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.UseShellExecute = false;
process.OutputDataReceived += new DataReceivedEventHandler(SortOutputHandler);
process.BeginOutputReadLine();
Any ideas how I can get it?