c# - How can I check for 3G, wifi, EDGE, Cellular Networks in Windows Phone 7? -


How can I check the 3G, WiFi, EDGE, cellular network in Windows Phone 7 using C #?

  NetworkInterfaceInternetfaceInfo = socket.GetCurrentNetworkInterface (); Var type = netInterfaceInfo.InterfaceType; Var sub-type = netInterfaceInfo.InterfaceSubtype;   

The NetworkInterface.NetworkInterfaceType property is not required to use (which leads to 30sec to defame); There is no need to trigger the hostname resolution to determine the network type; No need to hear the events of network changes

Of course, it works best with Combination with DeviceNetworkInformation.IsNetworkAvailable or NetworkInterface.GetIsNetworkAvailable () - They come back immediately, no matter whether you Whether or not the network is on. If you are, you first connect the socket and ask questions when it is connected: -)

One last note: Be aware of Mango's device network information. ISifine enabled - I thought whether it is on a WiFi network or not, but instead it is turned on or off in the wifi phone settings ... not super helpful.

Comments