G
Guest
Hi,
Can you let me know why this won't display the standard output on console?
Thanks
Process myProcess = new Process();
ProcessStartInfo myProcessStartInfo = new ProcessStartInfo("ipconfig" );
myProcessStartInfo.Arguments="/all";
myProcessStartInfo.UseShellExecute = false;
myProcessStartInfo.RedirectStandardOutput = true;
myProcess.StartInfo = myProcessStartInfo;
myProcess.Start();
StreamReader myStreamReader = myProcess.StandardOutput;
// Read the standard output of the spawned process.
string myString = myStreamReader.ReadLine();
Console.WriteLine(myString);
myProcess.Close();
Can you let me know why this won't display the standard output on console?
Thanks
Process myProcess = new Process();
ProcessStartInfo myProcessStartInfo = new ProcessStartInfo("ipconfig" );
myProcessStartInfo.Arguments="/all";
myProcessStartInfo.UseShellExecute = false;
myProcessStartInfo.RedirectStandardOutput = true;
myProcess.StartInfo = myProcessStartInfo;
myProcess.Start();
StreamReader myStreamReader = myProcess.StandardOutput;
// Read the standard output of the spawned process.
string myString = myStreamReader.ReadLine();
Console.WriteLine(myString);
myProcess.Close();