Ping Constructor ()

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Initializes a new instance of the Ping class.

Namespace:   System.Net.NetworkInformation
Assembly:  System (in System.dll)

public Ping()

The following code example demonstrates creating a Ping instance. The complete example is available in the Ping class overview.

Ping pingSender = new Ping ();

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

.NET Framework
Available since 2.0
Return to top
Show: