Dela via


NetworkConnectivityLevel Enum

Definition

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

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 LocalAccess as the current NetworkConnectivityLevel.

InternetAccess 3

Local and internet access.

Remarks

For an example of how these values are used to indicate connection changes, see Quickstart: Managing connection events and changes in availability.

Applies to

See also