NetworkChange.NetworkAvailabilityChanged 事件

定义

在网络的可用性更改时发生。Occurs when the availability of the network changes.

public:
 static event System::Net::NetworkInformation::NetworkAvailabilityChangedEventHandler ^ NetworkAvailabilityChanged;
public static event System.Net.NetworkInformation.NetworkAvailabilityChangedEventHandler NetworkAvailabilityChanged;
member this.NetworkAvailabilityChanged : System.Net.NetworkInformation.NetworkAvailabilityChangedEventHandler 
Public Shared Custom Event NetworkAvailabilityChanged As NetworkAvailabilityChangedEventHandler 

注解

当网络的可用性发生变化时,NetworkChange 类将引发 NetworkAvailabilityChanged 事件。The NetworkChange class raises NetworkAvailabilityChanged events when the availability of the network changes. 当至少一个网络接口标记为 "up" 且不是隧道或环回接口时,网络可用。The network is available when at least one network interface is marked "up" and is not a tunnel or loopback interface.

若要让 NetworkChange 对象在发生 NetworkAvailabilityChanged 事件时调用事件处理方法,必须将方法与 NetworkAvailabilityChangedEventHandler 委托相关联,并将此委托添加到此事件。To have a NetworkChange object call an event-handling method when a NetworkAvailabilityChanged event occurs, you must associate the method with a NetworkAvailabilityChangedEventHandler delegate, and add this delegate to this event.

Windows 2000 和更高版本支持 NetworkAvailabilityChanged 事件。The NetworkAvailabilityChanged event is supported on Windows 2000 and later.

适用于