can anybody give me a hint, how to programmatically detect in C# on Windows Phone 8.1. App (not 8.0!), if the WLAN is enabled / disabled? I don\'t want to chang
Use the IsWiFiEnabled
property of DeviceNetworkInformation class
You can refer to the How-To network information page if you need other network informations.
Regards.
If you're looking for a Non 8.1 Silverlight solution:
You can use the Windows.Networking.Connectivity
namespace to query this.
MSDN NetworkInformation class
An example to get you started
bool is_wifi_enabled = false;
Guid adapter_id = new Guid();
// get the list of connection profiles
// we need the adpater id for the wifi
foreach (var item in NetworkInformation.GetConnectionProfiles())
{
// check if wifi
if (item.IsWlanConnectionProfile)
{
// tag the adapter
adapter_id = item.NetworkAdapter.NetworkAdapterId;
}
}
// get all lan adapters (this most likely will be empty if wlan is disabled)
foreach (var item in NetworkInformation.GetLanIdentifiers())
{
if (item.NetworkAdapterId == adapter_id)
{
is_wifi_enabled = true;
}
}