Win8 app判断网络连接状态金沙网址

Win8 app判断网络连接状态,win8app

Win8 app判断网络连接状态

NetworkInformation.NetworkStatusChanged += NetworkInformation_NetworkStatusChanged; //网络连接发生变化时触发

        private bool IsConnectedToInternet()//有无网络连接判断
        {
            bool connected = false;
            ConnectionProfile Conpro = NetworkInformation.GetInternetConnectionProfile();
            if (Conpro != null)
            {
                NetworkConnectivityLevel network = Conpro.GetNetworkConnectivityLevel();
                connected = network == NetworkConnectivityLevel.InternetAccess;
            }
            return connected;
        }/* 何问起 hovertree.com */

推荐:

app判断网络连接状态,win8app Win8
app判断网络连接状态 NetworkInformation.NetworkStatusChanged +=
NetworkInformation_NetworkStatusChanged; // 网络连接发生变…

相关文章