开发者

How to check if the user is connected to the internet wp7 ?

开发者 https://www.devze.com 2023-03-24 23:36 出处:网络
how do you check if the user is connected 开发者_Go百科to the internet? ive a program that uses services and i\'d like to check first

how do you check if the user is connected 开发者_Go百科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:

if (NetworkInterface.GetIsNetworkAvailable())
{ 

}

Should be the correct way.


The phone api does not have a status for internet acces. 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?

0

精彩评论

暂无评论...
验证码 换一张
取 消