System.Diagnostic.Process question/problem
-
I'm having a bit of a problem getting this to work. I am writing an application that is using a StreamReader to read the output of a shell process. Here is the code to launch the process:
Process p = new Process(); p.StartInfo.Arguments = "-n 1 -w 200 " + ip; p.StartInfo.FileName = "ping.exe"; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.UseShellExecute = false; p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; p.Start();
The problem I'm having is that ProcessWindowStyle.Hidden seems to do nothing when UseShellExecute is = false. A (blank) console window still comes up for every IP address I'm trying to ping. Everything else works fine except the hiding of the window. I haven't been able to find anybody else that seems to be having this same issue out there. Any clues? -
I'm having a bit of a problem getting this to work. I am writing an application that is using a StreamReader to read the output of a shell process. Here is the code to launch the process:
Process p = new Process(); p.StartInfo.Arguments = "-n 1 -w 200 " + ip; p.StartInfo.FileName = "ping.exe"; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.UseShellExecute = false; p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; p.Start();
The problem I'm having is that ProcessWindowStyle.Hidden seems to do nothing when UseShellExecute is = false. A (blank) console window still comes up for every IP address I'm trying to ping. Everything else works fine except the hiding of the window. I haven't been able to find anybody else that seems to be having this same issue out there. Any clues?I used: p.CreateNoWindow = true; www.lovethosetrains.com
-
I used: p.CreateNoWindow = true; www.lovethosetrains.com
-
Just glad that I can actually be of help. www.lovethosetrains.com