WiFiAdapter Class

Definition

Use this class to enumerate local Wi-Fi adapters, initiate Wi-Fi scans, enumerate scan results, and to connect or disconnect individual adapters.

public ref class WiFiAdapter sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.DualApiPartition(version=167772160)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Static(Windows.Devices.WiFi.IWiFiAdapterStatics, 65536, Windows.Foundation.UniversalApiContract)]
class WiFiAdapter sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.DualApiPartition(version=167772160)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Static(Windows.Devices.WiFi.IWiFiAdapterStatics, 65536, "Windows.Foundation.UniversalApiContract")]
class WiFiAdapter sealed
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.DualApiPartition(version=167772160)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Static(typeof(Windows.Devices.WiFi.IWiFiAdapterStatics), 65536, typeof(Windows.Foundation.UniversalApiContract))]
public sealed class WiFiAdapter
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.DualApiPartition(version=167772160)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Static(typeof(Windows.Devices.WiFi.IWiFiAdapterStatics), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class WiFiAdapter
Public NotInheritable Class WiFiAdapter
Inheritance
WiFiAdapter
Attributes

Windows 10 requirements

Device family
Windows 10 (introduced in 10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Remarks

Your code uses the static methods of this class.

Version history

Windows version SDK version Value added
1709 16299 ConnectAsync(WiFiAvailableNetwork,WiFiReconnectionKind,PasswordCredential,String,WiFiConnectionMethod)
1709 16299 GetWpsConfigurationAsync

Properties

NetworkAdapter

Gets information about a Wi-Fi adapter.

NetworkReport

Gets a list of available networks populated by the last Wi-Fi scan on this WiFiNetworkAdapter.

Methods

ConnectAsync(WiFiAvailableNetwork, WiFiReconnectionKind)

Connect this Wi-Fi device to the specified network, with the specified reconnection policy.

ConnectAsync(WiFiAvailableNetwork, WiFiReconnectionKind, PasswordCredential)

Connect this Wi-Fi device to the specified network, with the specified passphrase and reconnection policy.

ConnectAsync(WiFiAvailableNetwork, WiFiReconnectionKind, PasswordCredential, String)

Connect this Wi-Fi device to a hidden network, with the given passphrase and reconnection policy.

ConnectAsync(WiFiAvailableNetwork, WiFiReconnectionKind, PasswordCredential, String, WiFiConnectionMethod)

Connect this Wi-Fi device to a hidden network, with the given passphrase, connection method, and reconnection policy.

Disconnect()

Disconnects any active Wi-Fi connection through this adapter.

FindAllAdaptersAsync()

A static method that initiates an asynchronous operation to enumerate all Wi-Fi adapters in the system.

Note that if you do not specify that your app has the wiFiControl capability in your app manifest, this method fails.

FromIdAsync(String)

A static method that initiates an asynchronous operation to get a WiFiAdapter object.

Note that if you do not specify that your app has the wiFiControl capability in your app manifest, this method fails.

GetDeviceSelector()

A static method that returns an Advanced Query Syntax (AQS) string to be used to enumerate Wi-Fi adapters using Windows.Devices.Enumeration.DeviceInformation.FindAllAsync and related methods.

GetWpsConfigurationAsync(WiFiAvailableNetwork)

Performs WPS discovery to query the WPS methods supported by the network.

RequestAccessAsync()

A static method for determining whether the current user can access any of the Wi-Fi adapters on this device.

Note that if you do not specify that your app has the wiFiControl capability in your app manifest, this method always returns DeniedBySystem.

Always returns DeniedBySystem on Xbox.

ScanAsync()

Directs this adapter to initiate an asynchronous network scan.

Events

AvailableNetworksChanged

Event raised when a scan completes on this Wi-Fi adapter. This event cannot be raised from a background task.

Applies to