I want to read the continuation of cmd output stream in C #. I know that I can redirect a standard output stream and read it. Below is the code:
System.Diagnostics.ProcessStartInfo pi= new System.Diagnostics.ProcessStartInfo(ProgramPATH,Params);
pi.RedirectStandardOutput = true;
pi.UseShellExecute = false;
pi.CreateNoWindow = true;
System.Diagnostics.Process proc= new System.Diagnostics.Process();
proc.StartInfo = pi;
proc.Start();
string result = proc.StandardOutput.ReadToEnd();
But this gives the whole result right away. What if I issue a command pingwith an argument -t? How can I read this stream continuously?
source
share