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

后端 未结 2 674
[愿得一人]
[愿得一人] 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 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.

提交回复
热议问题