System.Net.NetworkInformation.NetworkChange.NetworkAvailabilityChanged Event

Occurs when the availability of the network changes.

Syntax

public static event NetworkAvailabilityChangedEventHandler NetworkAvailabilityChanged

Remarks

The System.Net.NetworkInformation.NetworkChange class raises NetworkChange.NetworkAvailabilityChanged events when the availability of the network changes. The network is available when at least one network interface is marked "up" and is not a tunnel or loopback interface.

To have a System.Net.NetworkInformation.NetworkChange object call an event-handling method when a NetworkChange.NetworkAvailabilityChanged event occurs, you must associate the method with a System.Net.NetworkInformation.NetworkAvailabilityChangedEventHandler delegate, and add this delegate to this event.

The NetworkChange.NetworkAvailabilityChanged event is supported on Windows 2000 and later.

Requirements

Namespace: System.Net.NetworkInformation
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0