Wp检查手机网络状态
/// <summary>
/// 检查网络状态
/// </summary>
private void CheckNetworkState()
{
if (DeviceNetworkInformation.IsCellularDataEnabled)
{
lblPhoneNetwordState.Text = "手机网络(已打开)";
}
else
{
lblPhoneNetwordState.Text = "手机网络(已关闭)";
}
if (DeviceNetworkInformation.IsWiFiEnabled)
{
lblWiFiState.Text = "WiFi(已打开)";
}
else
{
lblWiFiState.Text = "WiFi(已关闭)";
}
}