using System.Diagnostics;
------------------------------- Process proc = new Process();
proc.StartInfo.FileName = @"ping.exe";
proc.StartInfo.Arguments = "www.sina.com.cn";
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardOutput = true;
proc.Start();
string output = proc.StandardOutput.ReadToEnd(); MessageBox.Show(output); MessageBox.Show((proc.ExitCode).ToString());ms-help://MS.VSCC/MS.MSDNVS.2052/cpref/html/frlrfsystemdiagnosticsprocessclassstandardoutputtopic.htm
------------------------------- Process proc = new Process();
proc.StartInfo.FileName = @"ping.exe";
proc.StartInfo.Arguments = "www.sina.com.cn";
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardOutput = true;
proc.Start();
string output = proc.StandardOutput.ReadToEnd(); MessageBox.Show(output); MessageBox.Show((proc.ExitCode).ToString());ms-help://MS.VSCC/MS.MSDNVS.2052/cpref/html/frlrfsystemdiagnosticsprocessclassstandardoutputtopic.htm
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货