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