方法一:调用cmd 的ping命令
private static string CmdPing(string strIp)
{
Process p = new Process(); p.StartInfo.FileName = cmd.exe;//设定程序名
p.StartInfo.UseShellExecute = false; //关闭Shell的使用
p.StartInfo.RedirectStandardInput = true;//重定向标准输入
p.StartInfo.RedirectStandardOutput = true;//重定向标准输出
p.