Retrieving Process output as it is written by the Process applicat
- From: "wgillin" <wgillin@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 19 Jul 2005 08:18:03 -0700
Is there a way to capture the standard output from an application running in
a System.Diagnostics.Process() as the output is written? MSDN mentions that
the process writes to a pipe and when the buffer is full it must be retrieved
by the parent of the Process. I would like to retrieve the data realtime,
not wait for the process to either complete or for the buffer to fill. If
this isn't possible is there a way to reduce the size of the buffer to make
it appear that the retrieval is realtime?
Process p = new Process();
p.StartInfo.CreateNoWindow = true;
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = @"c:\perl\bin\perl.exe";
p.StartInfo.Arguments = "test.pl";
p.Start();
textBox1.Text += p.StandardOutput.ReadToEnd();
p.WaitForExit();
.
- Prev by Date: Forms, SubForms and Continuous forms
- Next by Date: RE: ASP.NET - get rid of Session variables when done
- Previous by thread: Forms, SubForms and Continuous forms
- Next by thread: Localisation - changing locale on machine doesn't change windows form
- Index(es):
Relevant Pages
|