Ping 构造函数

定义

初始化 Ping 类的新实例。

public:
 Ping();
public Ping ();
Public Sub New ()

示例

下面的代码示例演示如何创建 Ping 实例。 类概述中 Ping 提供了完整的示例。

Ping ^ pingSender = gcnew Ping;

// When the PingCompleted event is raised,
// the PingCompletedCallback method is called.
pingSender->PingCompleted += gcnew PingCompletedEventHandler( PingCompletedCallback );
Ping pingSender = new Ping ();

// When the PingCompleted event is raised,
// the PingCompletedCallback method is called.
pingSender.PingCompleted += new PingCompletedEventHandler (PingCompletedCallback);

适用于