110,535
社区成员
发帖
与我相关
我的任务
分享
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName="cmd.exe";
psi.Arguments="/c ping www.163.com";
psi.RedirectStandardOutput=true;
psi.UseShellExecute=false;
Process p = new Process();
p.StartInfo= psi;
p = Process.Start(psi);
StreamReader ms = p.StandardOutput;
p.WaitForExit();
string s = ms.ReadToEnd();
Console.WriteLine(s);
Console.Read();