S
Sin Jeong-hun
Process p = new Process();
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.UseShellExecute = false;
p.Start();
p.StandardOutput.ReadToEnd();
This works if the application outputs very little amount of string and
exits quickly. But what if the application does a lengthy job and
outputs the progress and my C# application should be notified if the
job is progressed? Should I periodically invoke ReadToEnd() in a while
loop? Seems a waste of cpu cycles. Can't I just get notified when the
application outputs something instead? I tried to search the Internet
myself, but I couldn't find an answer.
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.UseShellExecute = false;
p.Start();
p.StandardOutput.ReadToEnd();
This works if the application outputs very little amount of string and
exits quickly. But what if the application does a lengthy job and
outputs the progress and my C# application should be notified if the
job is progressed? Should I periodically invoke ReadToEnd() in a while
loop? Seems a waste of cpu cycles. Can't I just get notified when the
application outputs something instead? I tried to search the Internet
myself, but I couldn't find an answer.