I am trying to display the output of a command-window in a textbox, but the code doesn't update. It only shows the first action, nothing more. What I want is it to update if new text appears in the commandline aswell.
Here is the code I have so far, which all get triggered on a button-click:
System.Diagnostics.ProcessStartInfo procStartInfo =
new System.Diagnostics.ProcessStartInfo("cmd", "/c " + command);
procStartInfo.RedirectStandardOutput = true;
procStartInfo.UseShellExecute = false;
procStartInfo.CreateNoWindow = true;
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo = procStartInfo;
proc.Start();
while (!proc.StandardOutput.EndOfStream)
{
string result = proc.StandardOutput.ReadToEnd();
TextAreaOutput.AppendText(result + "\n");
}
What am I missing?