Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Ping Constructor
Collapse the table of content
Expand the table of content

Ping Constructor

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

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft