Share via


WiFiAdapter.ConnectAsync Method

Definition

Overloads

ConnectAsync(WiFiAvailableNetwork, WiFiReconnectionKind)

Note

Some information relates to pre-released product, which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Important

This API will be affected by upcoming changes to operating system behavior, planned for fall 2024. For more info, 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.

ConnectAsync(WiFiAvailableNetwork, WiFiReconnectionKind, PasswordCredential)

Note

Some information relates to pre-released product, which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Important

This API will be affected by upcoming changes to operating system behavior, planned for fall 2024. For more info, 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, PasswordCredential, String)

Note

Some information relates to pre-released product, which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Important

This API will be affected by upcoming changes to operating system behavior, planned for fall 2024. For more info, 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, String, WiFiConnectionMethod)

Note

Some information relates to pre-released product, which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Important

This API will be affected by upcoming changes to operating system behavior, planned for fall 2024. For more info, 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)

Note

Some information relates to pre-released product, which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Important

This API will be affected by upcoming changes to operating system behavior, planned for fall 2024. For more info, 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.

public:
 virtual IAsyncOperation<WiFiConnectionResult ^> ^ ConnectAsync(WiFiAvailableNetwork ^ availableNetwork, WiFiReconnectionKind reconnectionKind) = ConnectAsync;
/// [Windows.Foundation.Metadata.Overload("ConnectAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<WiFiConnectionResult> ConnectAsync(WiFiAvailableNetwork const& availableNetwork, WiFiReconnectionKind const& reconnectionKind);
[Windows.Foundation.Metadata.Overload("ConnectAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<WiFiConnectionResult> ConnectAsync(WiFiAvailableNetwork availableNetwork, WiFiReconnectionKind reconnectionKind);
function connectAsync(availableNetwork, reconnectionKind)
Public Function ConnectAsync (availableNetwork As WiFiAvailableNetwork, reconnectionKind As WiFiReconnectionKind) As IAsyncOperation(Of WiFiConnectionResult)

Parameters

availableNetwork
WiFiAvailableNetwork

Describes the Wi-Fi network to be connected.

reconnectionKind
WiFiReconnectionKind

Specifies how to reconnect if the connection is lost.

Returns

An asynchronous connect operation. On successful conclusion of the operation, returns an object that describes the result of the connect operation.

Attributes

See also

Applies to

ConnectAsync(WiFiAvailableNetwork, WiFiReconnectionKind, PasswordCredential)

Note

Some information relates to pre-released product, which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Important

This API will be affected by upcoming changes to operating system behavior, planned for fall 2024. For more info, 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.

public:
 virtual IAsyncOperation<WiFiConnectionResult ^> ^ ConnectAsync(WiFiAvailableNetwork ^ availableNetwork, WiFiReconnectionKind reconnectionKind, PasswordCredential ^ passwordCredential) = ConnectAsync;
/// [Windows.Foundation.Metadata.Overload("ConnectWithPasswordCredentialAsync")]
IAsyncOperation<WiFiConnectionResult> ConnectAsync(WiFiAvailableNetwork const& availableNetwork, WiFiReconnectionKind const& reconnectionKind, PasswordCredential const& passwordCredential);
[Windows.Foundation.Metadata.Overload("ConnectWithPasswordCredentialAsync")]
public IAsyncOperation<WiFiConnectionResult> ConnectAsync(WiFiAvailableNetwork availableNetwork, WiFiReconnectionKind reconnectionKind, PasswordCredential passwordCredential);
function connectAsync(availableNetwork, reconnectionKind, passwordCredential)
Public Function ConnectAsync (availableNetwork As WiFiAvailableNetwork, reconnectionKind As WiFiReconnectionKind, passwordCredential As PasswordCredential) As IAsyncOperation(Of WiFiConnectionResult)

Parameters

availableNetwork
WiFiAvailableNetwork

Specifies the Wi-Fi network to connect to.

reconnectionKind
WiFiReconnectionKind

Describes how to reconnect to the network if connection is lost.

passwordCredential
PasswordCredential

The passphrase to be used to connect to the access point.

Returns

An asynchronous connect operation. On successful conclusion of the operation, returns an object that describes the result of the connect operation.

Attributes

See also

Applies to

ConnectAsync(WiFiAvailableNetwork, WiFiReconnectionKind, PasswordCredential, String)

Note

Some information relates to pre-released product, which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Important

This API will be affected by upcoming changes to operating system behavior, planned for fall 2024. For more info, 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.

public:
 virtual IAsyncOperation<WiFiConnectionResult ^> ^ ConnectAsync(WiFiAvailableNetwork ^ availableNetwork, WiFiReconnectionKind reconnectionKind, PasswordCredential ^ passwordCredential, Platform::String ^ ssid) = ConnectAsync;
/// [Windows.Foundation.Metadata.Overload("ConnectWithPasswordCredentialAndSsidAsync")]
IAsyncOperation<WiFiConnectionResult> ConnectAsync(WiFiAvailableNetwork const& availableNetwork, WiFiReconnectionKind const& reconnectionKind, PasswordCredential const& passwordCredential, winrt::hstring const& ssid);
[Windows.Foundation.Metadata.Overload("ConnectWithPasswordCredentialAndSsidAsync")]
public IAsyncOperation<WiFiConnectionResult> ConnectAsync(WiFiAvailableNetwork availableNetwork, WiFiReconnectionKind reconnectionKind, PasswordCredential passwordCredential, string ssid);
function connectAsync(availableNetwork, reconnectionKind, passwordCredential, ssid)
Public Function ConnectAsync (availableNetwork As WiFiAvailableNetwork, reconnectionKind As WiFiReconnectionKind, passwordCredential As PasswordCredential, ssid As String) As IAsyncOperation(Of WiFiConnectionResult)

Parameters

availableNetwork
WiFiAvailableNetwork

Describes the Wi-Fi network to connect to.

reconnectionKind
WiFiReconnectionKind

Describes how to reconnect to the network if connection is lost.

passwordCredential
PasswordCredential

Password or other credential to use to connect to the network.

ssid
String

Platform::String

winrt::hstring

When the network SSID is hidden, use this parameter to provide the SSID.

Returns

An asynchronous connect operation. On successful conclusion of the operation, returns an object that describes the result of the connect operation.

Attributes

See also

Applies to

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

Note

Some information relates to pre-released product, which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Important

This API will be affected by upcoming changes to operating system behavior, planned for fall 2024. For more info, 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.

public:
 virtual IAsyncOperation<WiFiConnectionResult ^> ^ ConnectAsync(WiFiAvailableNetwork ^ availableNetwork, WiFiReconnectionKind reconnectionKind, PasswordCredential ^ passwordCredential, Platform::String ^ ssid, WiFiConnectionMethod connectionMethod) = ConnectAsync;
/// [Windows.Foundation.Metadata.Overload("ConnectWithPasswordCredentialAndSsidAndConnectionMethodAsync")]
IAsyncOperation<WiFiConnectionResult> ConnectAsync(WiFiAvailableNetwork const& availableNetwork, WiFiReconnectionKind const& reconnectionKind, PasswordCredential const& passwordCredential, winrt::hstring const& ssid, WiFiConnectionMethod const& connectionMethod);
[Windows.Foundation.Metadata.Overload("ConnectWithPasswordCredentialAndSsidAndConnectionMethodAsync")]
public IAsyncOperation<WiFiConnectionResult> ConnectAsync(WiFiAvailableNetwork availableNetwork, WiFiReconnectionKind reconnectionKind, PasswordCredential passwordCredential, string ssid, WiFiConnectionMethod connectionMethod);
function connectAsync(availableNetwork, reconnectionKind, passwordCredential, ssid, connectionMethod)
Public Function ConnectAsync (availableNetwork As WiFiAvailableNetwork, reconnectionKind As WiFiReconnectionKind, passwordCredential As PasswordCredential, ssid As String, connectionMethod As WiFiConnectionMethod) As IAsyncOperation(Of WiFiConnectionResult)

Parameters

availableNetwork
WiFiAvailableNetwork

Specifies the Wi-Fi network to connect to.

reconnectionKind
WiFiReconnectionKind

Specifies how to reconnect if the connection is lost.

passwordCredential
PasswordCredential

The passphrase to be used to connect to the access point.

ssid
String

Platform::String

winrt::hstring

When the network SSID is hidden, use this parameter to provide the SSID.

connectionMethod
WiFiConnectionMethod

A WiFiConnectionMethod enumeration member indicating the connection method.

Returns

An asynchronous connect operation. On successful conclusion of the operation, returns an object that describes the result of the connect operation.

Attributes

Windows requirements

Device family
Windows 10 Fall Creators Update (introduced in 10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v5.0)

See also

Applies to