共用方式為


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 

事件類型

屬性

備註

當網路的可用性變更時,類別 NetworkChangeNetworkAvailabilityChanged 引發事件。 當至少有一個網路介面標示為「向上」且不是通道或回送介面時,即可使用網路。

若要讓 NetworkChange 物件在事件發生時 NetworkAvailabilityChanged 呼叫事件處理方法,您必須將方法與 NetworkAvailabilityChangedEventHandler 委派產生關聯,並將此委派新增至此事件。

適用於