How to enable / disable Wifi in Windows Phone using C# ?

If you are a Developer and have an task to change or access the Wifi Settings via some user interaction , you can use the Launcher “ConnectionSettingsTask” to achieve it.

Just use the ConnectionSettingsType to Wifi and call the show method of the ConnectionSettingsTask . This will Launch the Wifi Settings Window and lets the user to change the Wifi settings or even enable or disable the Wifi .

Yo use the launcher , use the namespace Microsoft.Phone.Tasks;

private void button1_Click(object sender, RoutedEventArgs e)
{
ConnectionSettingsTask connectionSettingsTask = new ConnectionSettingsTask();
connectionSettingsTask.ConnectionSettingsType = ConnectionSettingsType.WiFi;
connectionSettingsTask.Show();
}

via windowsphonerocks.com

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.
Pin It

Leave a Reply

Your email address will not be published. Required fields are marked *