Hi,
Just wondering if anyone knows how to process a command response, such as a "ping", in C#? For example, I know if you make the call, using the System.Diagnost ics namespace, "Process process = Process.Start(" cmd", "/C ping localhost > ping.txt");" starts the command prompt and runs the ping command and then stores the output into the ping.txt file. I'm just wondering if there's a way to avoid the copying of the output to a text file, and routing it to a local string variable in my code, so that I can process it directly? Or is processing the output via the text file the only way?
Thanks in advanced!
-Weeg
Just wondering if anyone knows how to process a command response, such as a "ping", in C#? For example, I know if you make the call, using the System.Diagnost ics namespace, "Process process = Process.Start(" cmd", "/C ping localhost > ping.txt");" starts the command prompt and runs the ping command and then stores the output into the ping.txt file. I'm just wondering if there's a way to avoid the copying of the output to a text file, and routing it to a local string variable in my code, so that I can process it directly? Or is processing the output via the text file the only way?
Thanks in advanced!
-Weeg
Comment