public async Task <bool> DisconnectNetworkAsync(ProfileItem profileItem, TimeSpan timeout) { if (profileItem == null) { throw new ArgumentNullException(nameof(profileItem)); } return(await NativeWifi.DisconnectNetworkAsync(profileItem.InterfaceId, timeout)); }
public async Task DisConnectWifi() { var wireless = NativeWifi.EnumerateAvailableNetworks().FirstOrDefault(x => x.Ssid.ToString().Equals("wireless")); if (wireless != null) { await NativeWifi.DisconnectNetworkAsync(wireless.Interface.Id, TimeSpan.FromSeconds(30)); } }