Я пишу приложение, отключающее WiFi. Этого нельзя сделать, отключив сетевой адаптер с помощью WMI или вызвав netsh и т. д. Для Windows 10 у меня работает следующий код. Как сделать то же самое для Windows 8?
using Windows.Devices.Radios;
public async void TurnWifiOff()
{
await Radio.RequestAccessAsync();
var radios = await Radio.GetRadiosAsync();
foreach (var radio in radios)
{
if (radio.Kind == RadioKind.WiFi)
{
await radio.SetStateAsync(RadioState.Off);
}
}
}