Gets the network connectivity level for this connection. This value indicates what network resources, if any, are currently available.
public:
NetworkConnectivityLevel GetNetworkConnectivityLevel()
Type: NetworkConnectivityLevel
The level of network connectivity.
Note GetNetworkConnectivityLevel is not thread-safe. Your code should ensure that it is only called from one thread at a time.
The GetNetworkConnectivityLevel method may take considerable time in some cases to determine the current value of the network connectivity level.
The best practice for determining the network connectivity level is to register a handler for the NetworkStatusChanged event on the NetworkInformation class. When a notification is received of a network status change, obtain the new connectivity level by calling the GetNetworkConnectivityLevel method on the profile returned by the GetInternetConnectionProfile method. The returned network connectivity level can then be stored for later use when needed. This also ensures that the correct ConnectionProfile is checked.
Namespace: Windows.Networking.Connectivity
Metadata: windows.winmd