NetworkChange.NetworkAvailabilityChanged 事件

定义

在网络的可用性更改时发生。

public:
 static event System::Net::NetworkInformation::NetworkAvailabilityChangedEventHandler ^ NetworkAvailabilityChanged;
public static event System.Net.NetworkInformation.NetworkAvailabilityChangedEventHandler? NetworkAvailabilityChanged;
[System.Runtime.Versioning.UnsupportedOSPlatform("illumos")]
[System.Runtime.Versioning.UnsupportedOSPlatform("solaris")]
public static event System.Net.NetworkInformation.NetworkAvailabilityChangedEventHandler? NetworkAvailabilityChanged;
public static event System.Net.NetworkInformation.NetworkAvailabilityChangedEventHandler NetworkAvailabilityChanged;
member this.NetworkAvailabilityChanged : System.Net.NetworkInformation.NetworkAvailabilityChangedEventHandler 
[<System.Runtime.Versioning.UnsupportedOSPlatform("illumos")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("solaris")>]
member this.NetworkAvailabilityChanged : System.Net.NetworkInformation.NetworkAvailabilityChangedEventHandler 
Public Shared Custom Event NetworkAvailabilityChanged As NetworkAvailabilityChangedEventHandler 

事件类型

属性

注解

NetworkChange 网络的可用性发生更改时, 类将引发 NetworkAvailabilityChanged 事件。 当至少有一个网络接口标记为“up”并且不是隧道或环回接口时,该网络可用。

若要使 NetworkChange 对象在事件发生时 NetworkAvailabilityChanged 调用事件处理方法,必须将 该方法与 NetworkAvailabilityChangedEventHandler 委托相关联,并将此委托添加到此事件。

适用于