Hi,
Can you let me know why this won't display the standard output on console?
Thanks
Process myProcess = new Process();
ProcessStartInf o myProcessStartI nfo = new ProcessStartInf o("ipconfig" );
myProcessStartI nfo.Arguments="/all";
myProcessStartI nfo.UseShellExe cute = false;
myProcessStartI nfo.RedirectSta ndardOutput = true;
myProcess.Start Info = myProcessStartI nfo;
myProcess.Start ();
StreamReader myStreamReader = myProcess.Stand ardOutput;
// Read the standard output of the spawned process.
string myString = myStreamReader. ReadLine();
Console.WriteLi ne(myString);
myProcess.Close ();
Can you let me know why this won't display the standard output on console?
Thanks
Process myProcess = new Process();
ProcessStartInf o myProcessStartI nfo = new ProcessStartInf o("ipconfig" );
myProcessStartI nfo.Arguments="/all";
myProcessStartI nfo.UseShellExe cute = false;
myProcessStartI nfo.RedirectSta ndardOutput = true;
myProcess.Start Info = myProcessStartI nfo;
myProcess.Start ();
StreamReader myStreamReader = myProcess.Stand ardOutput;
// Read the standard output of the spawned process.
string myString = myStreamReader. ReadLine();
Console.WriteLi ne(myString);
myProcess.Close ();
Comment