NetworkInformation.NetworkStatusChanged Evento
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Si verifica quando lo stato della rete cambia per una connessione.
public:
static event NetworkStatusChangedEventHandler ^ NetworkStatusChanged;
// Register
static event_token NetworkStatusChanged(NetworkStatusChangedEventHandler const& handler) const;
// Revoke with event_token
static void NetworkStatusChanged(event_token const* cookie) const;
// Revoke with event_revoker
static NetworkInformation::NetworkStatusChanged_revoker NetworkStatusChanged(auto_revoke_t, NetworkStatusChangedEventHandler const& handler) const;
C#
public static event NetworkStatusChangedEventHandler NetworkStatusChanged;
function onNetworkStatusChanged(eventArgs) { /* Your code */ }
Windows.Networking.Connectivity.NetworkInformation.addEventListener("networkstatuschanged", onNetworkStatusChanged);
Windows.Networking.Connectivity.NetworkInformation.removeEventListener("networkstatuschanged", onNetworkStatusChanged);
- or -
Windows.Networking.Connectivity.NetworkInformation.onnetworkstatuschanged = onNetworkStatusChanged;
Public Shared Custom Event NetworkStatusChanged As NetworkStatusChangedEventHandler
Prodotto | Versioni |
---|---|
WinRT | Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100 |