Hi, I have a small dos program that compiles txt files. The dos program
checks the text file, and if there's an error or if the text is ok it
sends a message to the dos prompt. I would like to capture this message
and display it in a textbox. I have already tried with the code below,
but i don't get the output from the text compler program, but I do get
some DOS output like the path the program is in etc. Does anybody know
how to solve this problem????
System.Diagnostics.Process p2 = new System.Diagnostics.Process();
StreamWriter sw2;
StreamReader sr2;
StreamReader err2;
System.Diagnostics.ProcessStartInfo psI2 = new
System.Diagnostics.ProcessStartInfo("POINT");
psI2.UseShellExecute = false;
psI2.RedirectStandardInput = true;
psI2.RedirectStandardOutput = true;
psI2.RedirectStandardError = true;
psI2.CreateNoWindow = true;
psI2.Arguments = "/K" + compileTextFile;
p2.StartInfo = psI2;
p2.Start();
sw2 = p2.StandardInput;
sr2 = p2.StandardOutput;
err2 = p2.StandardError;
textBox1.Text = sr2;
Thanks!