NetworkConnectivityLevel Enum
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Defines the level of connectivity currently available.
public enum class NetworkConnectivityLevel
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
enum class NetworkConnectivityLevel
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public enum NetworkConnectivityLevel
var value = Windows.Networking.Connectivity.NetworkConnectivityLevel.none
Public Enum NetworkConnectivityLevel
- Inheritance
-
NetworkConnectivityLevel
- Attributes
Windows requirements
| Requirements | Description |
|---|---|
| Device family |
Windows 10 (introduced in 10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced in v1.0)
|
Fields
| Name | Value | Description |
|---|---|---|
| None | 0 | No connectivity. |
| LocalAccess | 1 | Local network access only. |
| ConstrainedInternetAccess | 2 | Limited internet access. This value is an indication that the connection is constrained, possibly due to a captive portal. Or possibly due to some other reason; for example, a proxy between the client and the internet that's modifying the HTTP header in some unknown way. In the case of captive portal connectivity, local access to a web portal is provided, but access to the internet requires that specific credentials are provided via the portal. This level of connectivity (limited internet access) is generally encountered when using connections hosted in public locations (for example, coffee shops and book stores). Note As mentioned, this doesn't necessarily mean that a captive portal has been detected. You should also test whether the captive portal can be reached by using a URL for the captive portal, or by attempting access to a public web site, which will then redirect to the captive portal when Windows reports |
| InternetAccess | 3 | Local and internet access. |
Remarks
Important
The network status reported by Windows APIs is only a hint - its accuracy may vary depending on the local network
topology and conditions. Apps should attempt to connect to their services whenever LocalAccess or higher connectivity
is reported.
For a complete implementation demonstrating connection attempts with any level of local connectivity, see the NetworkConnectivity sample.