示例#1
0
 public async static void SetWifiRadiosState(Windows.Devices.Radios.Radio radio, bool isopen)
 {
     if (radio.Kind == Windows.Devices.Radios.RadioKind.WiFi)
     {
         if (radio.State != Windows.Devices.Radios.RadioState.On)
         {
             if (isopen)
             {
                 await radio.SetStateAsync(Windows.Devices.Radios.RadioState.On);
             }
         }
         else
         {
             if (!isopen)
             {
                 await radio.SetStateAsync(Windows.Devices.Radios.RadioState.Off);
             }
         }
         return;
     }
 }