继承层次结构
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
System.Net.NetworkInformation.Ping
System.MarshalByRefObject
System.ComponentModel.Component
System.Net.NetworkInformation.Ping
命名空间: System.Net.NetworkInformation
程序集: System(在 System.dll 中)
语法
| 名称 | 说明 | |
|---|---|---|
![]() |
CreateObjRef | 创建一个对象,该对象包含生成用于与远程对象进行通信的代理所需的全部相关信息。(继承自MarshalByRefObject。) |
![]() |
Dispose() | 释放由 Component 使用的所有资源。(继承自Component。) |
![]() |
Dispose(Boolean) | 释放由 Ping 对象使用的非托管资源,并可根据需要释放托管资源。(重写Component.Dispose(Boolean)。) |
![]() |
Equals(Object) | 确定指定的 |

本文详细介绍了C#中的Ping类,用于检测远程计算机的可达性。通过发送ICMP回送请求并接收答复,Ping类提供同步和异步方法。示例代码展示了如何同步和异步地使用Ping类进行网络检测。





1179

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



