Reputation: 1112
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
Upvotes: 8
Views: 6971
Reputation: 1969
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?
Upvotes: 0
Reputation: 210
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.
Upvotes: 16