why the NetworkInterface.GetIsNetworkAvailable() method always returns true,when i debug it on my windows phone 7 device?not emulator,is it sure that “NetworkInterface.NetworkInterfaceType==NetworkInterface.None” means a device does’t get network access?how can i detect whether a device connected a network that has intenert access? i tried this link,Zune-Detection-and-Network-Awareness,but the NetworkInterface.GetIsNetworkAvailable() method always returns true,which stumbled me a lot.Thanks for your help.
why the NetworkInterface.GetIsNetworkAvailable() method always returns true,when i debug it on my windows phone
Share
Read the documentation for the method. Here is what MSDN has to say:
Generally, you could say that this method is generally prone to errors. I would recommend taking the approach of failed requests – have a couple of URLs to test against and check if HTTP/DNS resolve requests go through. If some of them pass – there is a connection. If all fail – chances are you are not connected.
Here is a sample.