连接配置文件 API

The connection profile API, which is part of Windows.Networking.Connectivity.NetworkInformation, provides connectivity, usage, and data plan information for established network connections. The connection profiles associated with a given mobile account can be retrieved by using the MobileBroadbandAccount API. 连接配置文件 API 允许移动宽带应用在移动宽带接口上查询网络连接的多个属性,包括:

  • GetNetworkConnectivityLevel Indicates whether the network is connected and if the network provides internet connectivity.

  • GetSignalBars Indicates the current number of signal bars displayed by the Windows UI for the connection.

  • GetNetworkUsageAsync Provides bytes sent, bytes received, and connectivity times for a connection profile.

此 API 还包括一个状态更改事件,每当作员接口上的连接发生更改时通知应用程序。 For more info about the NetworkStatusChanged event, see NetworkStatusChangedEventHandler delegate.

移动宽带 Windows 运行时 API 列表

网络信息示例

NetworkStatusChangedEventHandler delegate