Windows 10上的方法DeviceNetworkInformation.IsWiFiEnabled无法启用/关闭检查wifi的任何建议吗?
答案 0 :(得分:5)
您可以执行以下操作:
using Windows.Devices.Radios;
public async Task<bool> IsWifiOn()
{
await Radio.RequestAccessAsync();
var radios = await Radio.GetRadiosAsync();
foreach (var radio in radios)
{
if (radio.Kind == RadioKind.WiFi)
{
return radio.State == RadioState.On;
}
}
return false;
}