WiFiAdapter Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Important
Location consent is now required for Wi-Fi BSSID access. For details on how this affects apps using Wi-Fi or location APIs, see Changes to API behavior for Wi-Fi access and location.
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.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class WiFiAdapter final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class WiFiAdapter
Public NotInheritable Class WiFiAdapter
- Inheritance
- Attributes
Windows 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 |
Important Location consent is now required for Wi-Fi BSSID access. For details on how this affects apps using Wi-Fi or location APIs, see Changes to API behavior for Wi-Fi access and location. Gets information about a Wi-Fi adapter. |
| NetworkReport |
Important Location consent is now required for Wi-Fi BSSID access. For details on how this affects apps using Wi-Fi or location APIs, see Changes to API behavior for Wi-Fi access and location. Gets a list of available networks populated by the last Wi-Fi scan on this WiFiNetworkAdapter. |
Methods
| ConnectAsync(WiFiAvailableNetwork, WiFiReconnectionKind, PasswordCredential, String, WiFiConnectionMethod) |
Important Location consent is now required for Wi-Fi BSSID access. For details on how this affects apps using Wi-Fi or location APIs, see Changes to API behavior for Wi-Fi access and location. Connect this Wi-Fi device to a hidden network, with the given passphrase, connection method, and reconnection policy. |
| ConnectAsync(WiFiAvailableNetwork, WiFiReconnectionKind, PasswordCredential, String) |
Important Location consent is now required for Wi-Fi BSSID access. For details on how this affects apps using Wi-Fi or location APIs, see Changes to API behavior for Wi-Fi access and location. Connect this Wi-Fi device to a hidden network, with the given passphrase and reconnection policy. |
| ConnectAsync(WiFiAvailableNetwork, WiFiReconnectionKind, PasswordCredential) |
Important Location consent is now required for Wi-Fi BSSID access. For details on how this affects apps using Wi-Fi or location APIs, see Changes to API behavior for Wi-Fi access and location. Connect this Wi-Fi device to the specified network, with the specified passphrase and reconnection policy. |
| ConnectAsync(WiFiAvailableNetwork, WiFiReconnectionKind) |
Important Location consent is now required for Wi-Fi BSSID access. For details on how this affects apps using Wi-Fi or location APIs, see Changes to API behavior for Wi-Fi access and location. Connect this Wi-Fi device to the specified network, with the specified reconnection policy. |
| Disconnect() |
Important Location consent is now required for Wi-Fi BSSID access. For details on how this affects apps using Wi-Fi or location APIs, see Changes to API behavior for Wi-Fi access and location. Disconnects any active Wi-Fi connection through this adapter. |
| FindAllAdaptersAsync() |
Important Location consent is now required for Wi-Fi BSSID access. For details on how this affects apps using Wi-Fi or location APIs, see Changes to API behavior for Wi-Fi access and location. 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) |
Important Location consent is now required for Wi-Fi BSSID access. For details on how this affects apps using Wi-Fi or location APIs, see Changes to API behavior for Wi-Fi access and location. 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() |
Important Location consent is now required for Wi-Fi BSSID access. For details on how this affects apps using Wi-Fi or location APIs, see Changes to API behavior for Wi-Fi access and location. 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) |
Important Location consent is now required for Wi-Fi BSSID access. For details on how this affects apps using Wi-Fi or location APIs, see Changes to API behavior for Wi-Fi access and location. Performs WPS discovery to query the WPS methods supported by the network. |
| RequestAccessAsync() |
Important Location consent is now required for Wi-Fi BSSID access. For details on how this affects apps using Wi-Fi or location APIs, see Changes to API behavior for Wi-Fi access and location. 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() |
Important Location consent is now required for Wi-Fi BSSID access. For details on how this affects apps using Wi-Fi or location APIs, see Changes to API behavior for Wi-Fi access and location. Directs this adapter to initiate an asynchronous network scan. |
Events
| AvailableNetworksChanged |
Important Location consent is now required for Wi-Fi BSSID access. For details on how this affects apps using Wi-Fi or location APIs, see Changes to API behavior for Wi-Fi access and location. Event raised when a scan completes on this Wi-Fi adapter. This event cannot be raised from a background task. |