Windows Phone 8 Connection Handler / Internet Availability

后端 未结 3 1940
暖寄归人
暖寄归人 2020-12-10 04:10

My team is working on a team project aplication. At the moment, we need an event handler to check the connection status (if it\'s on/off).

I had big hopes in the <

3条回答
  •  旧时难觅i
    2020-12-10 04:51

    Try this:

    bool isNetwork=NetworkInterface.GetIsNetworkAvailable();
    if(!isNetwork)
    {
       //proceed with your code
    
    }
    

提交回复
热议问题