Is there an easier fast way to detect whether the (Windows Phone 7) device has an internet connection

后端 未结 2 673
[愿得一人]
[愿得一人] 2021-01-02 18:27

Is there an easier fast way to detect whether the (Windows Phone 7) device has an internet connection.

I\'m currently sending a web request, waiting the timeout pe

相关标签:
2条回答
  • 2021-01-02 18:49

    There isn't really a faster way, though instead of a dummy request for this, perhaps you could actually make the request for data that you want, so if it does come back, you can handle the data without making a 2nd request.

    0 讨论(0)
  • 2021-01-02 19:14

    This method will return NetworkInterfaceType.None if there is no connection.

    NetworkInterface.GetInternetInterfaceType

    Alternatively you will get NetworkInterfaceType.MobileBroadbandGSM, NetworkInterfaceType.Wireless80211, etc if there is a connection.

    0 讨论(0)
提交回复
热议问题