How can I turn on / off WiFi programmatically on WP7

I would like to know if it is possible to enable and disable Wi-Fi. My idea is to have a background task that searches for geo-coordinates and switches Wi-Fi settings if the phone is in the range of a previously saved location or not.

But all I saw were applications that get Wi-Fi status and a quick transition to Wi-Fi settings. I would like to implement a more automated application that helps save battery power.

+4
source share
2 answers

Sorry, you cannot programmatically enable or disable Wi-Fi. The best you can do is show the WIFI settings page and let the user take care of it.

+6
source

You can display a dialog like this.

ConnectionSettingsTask connectionSettingsTask = new ConnectionSettingsTask(); connectionSettingsTask.ConnectionSettingsType = ConnectionSettingsType.WiFi; connectionSettingsTask.Show(); 
+5
source

Source: https://habr.com/ru/post/1396018/


All Articles