在 Windows 7 机器上,我 ping 关闭机器的 IP 地址。
C:\>ping 192.168.1.222
Pinging 192.168.1.222 with 32 bytes of data:
Reply from 192.168.1.222: Destination host unreachable.
Reply from 192.168.1.222: Destination host unreachable.
Reply from 192.168.1.222: Destination host unreachable.
Ping statistics for 192.168.1.222:
Packets: Sent = 3, Received = 3, Lost = 0 (0% loss)
Run Code Online (Sandbox Code Playgroud)
即使没有回复,错误级别也设置为0。
我想要做的是弄清楚远程机器是否正在回复 ping。我的测试之一是关闭机器并ping它。出于某种原因,ping 将错误级别设置为0.