PingOptions Constructor ()

 

Initializes a new instance of the PingOptions class.

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

public PingOptions()

The following table shows initial property values for an instance of PingOptions.

Property

Initial Value

Ttl

128

DontFragment

false

You can set the properties to new values before calling Send or SendAsync.

The following code example demonstrates calling this constructor.

Ping pingSender = new Ping ();
PingOptions options = new PingOptions ();

// Use the default Ttl value which is 128,
// but change the fragmentation behavior.
options.DontFragment = true;

.NET Framework
Available since 2.0
Return to top
Show: