D
David Meier
Hi list,
I wonder if there is a way in C# to continuously redirect shell output
to a text box.
That's what I am doing: I call rsync.exe which runs within a cygwin
shell. Now, I want to display the stdout as soon as it gets written. I
use System.Diagnostics and it works fine but it waits for the rsync
process to terminate before writing stdout to the text box.
Process rsync = new Process();
ProcessStartInfo rsync_info = new
ProcessStartInfo(@"/path/to/rsync.exe");
rsync_info.CreateNoWindow = true;
rsync_info.UseShellExecute = false;
rsync_info.RedirectStandardOutput = true;
rsync.StartInfo = rsync_info;
rsync.Start();
string output = rsync.StandardOutput.ReadToEnd();
rsync.WaitForExit();
this.myTextBox.AppendText(output);
Any ideas, hints and comments on this are highly welcome! Thanks.
Dave
I wonder if there is a way in C# to continuously redirect shell output
to a text box.
That's what I am doing: I call rsync.exe which runs within a cygwin
shell. Now, I want to display the stdout as soon as it gets written. I
use System.Diagnostics and it works fine but it waits for the rsync
process to terminate before writing stdout to the text box.
Process rsync = new Process();
ProcessStartInfo rsync_info = new
ProcessStartInfo(@"/path/to/rsync.exe");
rsync_info.CreateNoWindow = true;
rsync_info.UseShellExecute = false;
rsync_info.RedirectStandardOutput = true;
rsync.StartInfo = rsync_info;
rsync.Start();
string output = rsync.StandardOutput.ReadToEnd();
rsync.WaitForExit();
this.myTextBox.AppendText(output);
Any ideas, hints and comments on this are highly welcome! Thanks.
Dave