Process p = new Process(); p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.FileName = "ipconfig.exe"; p.StartInfo.Arguments = @"/all"; p.Start(); p.WaitForExit(); string strResult = p.StandardOutput.ReadToEnd();
PS: If your command doesn't work when you change the parameters, try to comment out the
p.WaitForExit();
No comments:
Post a Comment