Wp检查手机网络状态

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

if (DeviceNetworkInformation.IsWiFiEnabled)
{
lblWiFiState.Text = "WiFi(已打开)";
}
else
{
lblWiFiState.Text = "WiFi(已关闭)";
}
}

posted @ 2013-06-28 16:34  wadeflash  阅读(483)  评论(3编辑  收藏  举报