简体   繁体   中英

How to check if wifi is turned on/off in platform Windows Phone 8.1?

The method DeviceNetworkInformation.IsWiFiEnabled ins't available on WP8.1 any suggestion for check wifi is turned on/off?

I should get only if the wifi is turned on/off in platform.

Any help?

Not that I tried it, but according to documentation , DeviceNetworkInformation.IsWiFiEnabled should be available for:

Windows Phone OS
Supported in: 8.1, 8.0, 7.1

If ti is not then you should probably fill in the bug report to Microsoft.

Using WinRT API GetHostNames() which returns list of the local host names(ipaddress) on the device. Based on Iana interface, you can identify whether it's Cellular or Wifi. If the IP address is available for WiFi , then you can assume that it is enabled.

See my workaround here WiFi enable/disabled based on ID .

It involves matching the WiFi NetworkAdapterId with all IDs that are turned on.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM