Looking for example of C# WinForms app showing output from a batch file -


I encoding # The example project of a WinForms app that redirects the output that runs from a batch file in any type of background WinForms's control.

Any suggestions?

I do not know if you're going to 'find a direct example, but it is highly It's not difficult I do not have the time to write all the code for you, but I can give you the code from MSDN:

  process My process = new process (); ProcessStartInfo myProcessStartInfo = New ProcessStartInfo ("C: \\ MyBatchFile.bat"); MyProcessStartInfo.UseShellExecute = false; MyProcessStartInfo.RedirectStandardOutput = True; MyProcess.StartInfo = myProcessStartInfo; MyProcess.Start (); Streamer MyStreamReader = myProcess.StandardOutput; // Read standard output of the generated process. String MyString = myStreamReader.ReadToEnd (); MyProcess.Close (); // Now you have a batch file in myString  

Comments