[英]How to check if the user is connected to the internet wp7 ?
how do you check if the user is connected to the internet ? 你如何检查用户是否连接到互联网? ive a program that uses services and i'd like to check first 我有一个使用服务的程序,我想先检查一下
thanks 谢谢
As seen on http://www.diaryofaninja.com/blog/2010/12/09/checking-for-network-connectivity-in-windows-phone-7-sdk : 如http://www.diaryofaninja.com/blog/2010/12/09/checking-for-network-connectivity-in-windows-phone-7-sdk所示 :
if (NetworkInterface.GetIsNetworkAvailable())
{
}
Should be the correct way. 应该是正确的方法。
The phone api does not have a status for internet acces. 电话api没有互联网接入的状态。 You will need to actually make a call to test whether it's available despite the various statuses. 尽管存在各种状态,您仍需要实际拨打电话以测试它是否可用。 See What is the best way to check for Internet connectivity using .NET? 请参阅使用.NET检查Internet连接的最佳方法是什么?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.