是否有更简单快速的方法来检测(Windows Phone 7)设备是否具有互联网连接 [英] Is there an easier fast way to detect whether the (Windows Phone 7) device has an internet connection

查看:23
本文介绍了是否有更简单快速的方法来检测(Windows Phone 7)设备是否具有互联网连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有更简单快速的方法来检测(Windows Phone 7)设备是否具有互联网连接.

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 period and handling the exception. Hoping for a quick easy way to query the device to see whether it has a connection before sending any requests...

提前致谢,

推荐答案

如果没有连接,此方法将返回 NetworkInterfaceType.None.

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

NetworkInterface.GetInternetInterfaceType

或者,如果有连接,您将获得 NetworkInterfaceType.MobileBroadbandGSM、NetworkInterfaceType.Wireless80211 等.

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

这篇关于是否有更简单快速的方法来检测(Windows Phone 7)设备是否具有互联网连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆