private static string CmdPing(string strIp)
{
Process p = new Process();
//设定程序名
p.StartInfo.FileName = "cmd.exe";
//关闭Shell的使用
p.StartInfo.UseShellExecute = false;
//重定向标准输入
p.StartInfo.RedirectStandardInput = true;
//重定向标准输出
&nbs

该博客介绍了如何在C#中调用CMD命令行执行PING操作,并解析返回结果以判断网络连接状态,如:连接成功、无法到达目的主机、超时或无法解析主机。

328

被折叠的 条评论
为什么被折叠?



