NetworkOperatorTetheringManager.StartTetheringAsync 方法

定义

重载

StartTetheringAsync()

建立网络网络。

建议首先调用 StopTetheringAsync ,以确保共享热点处于关闭状态。

StartTetheringAsync(NetworkOperatorTetheringSessionAccessPointConfiguration)

使用指定的每会话配置启动移动热点。

此重载允许您启动网络会话,而无需通过 ConfigureAccessPointAsync 对其进行预配置。 作为参数传递的配置仅对当前会话有效,会话结束后将丢失。

通过 StartTetheringAsync 的此重载启动新会话,还可以配置无法通过 ConfigureAccessPointAsync 永久设置的仅会话参数。 可以保留的参数是网络 SSID、网络密码、网络无线频带和网络身份验证算法。

建议首先调用 StopTetheringAsync ,以确保共享热点处于关闭状态。

StartTetheringAsync()

建立网络网络。

建议首先调用 StopTetheringAsync ,以确保共享热点处于关闭状态。

public:
 virtual IAsyncOperation<NetworkOperatorTetheringOperationResult ^> ^ StartTetheringAsync() = StartTetheringAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<NetworkOperatorTetheringOperationResult> StartTetheringAsync();
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<NetworkOperatorTetheringOperationResult> StartTetheringAsync();
function startTetheringAsync()
Public Function StartTetheringAsync () As IAsyncOperation(Of NetworkOperatorTetheringOperationResult)

返回

网络共享操作的结果。

属性

Windows 要求

应用功能
wiFiControl

适用于

StartTetheringAsync(NetworkOperatorTetheringSessionAccessPointConfiguration)

使用指定的每会话配置启动移动热点。

此重载允许您启动网络会话,而无需通过 ConfigureAccessPointAsync 对其进行预配置。 作为参数传递的配置仅对当前会话有效,会话结束后将丢失。

通过 StartTetheringAsync 的此重载启动新会话,还可以配置无法通过 ConfigureAccessPointAsync 永久设置的仅会话参数。 可以保留的参数是网络 SSID、网络密码、网络无线频带和网络身份验证算法。

建议首先调用 StopTetheringAsync ,以确保共享热点处于关闭状态。

public:
 virtual IAsyncOperation<NetworkOperatorTetheringOperationResult ^> ^ StartTetheringAsync(NetworkOperatorTetheringSessionAccessPointConfiguration ^ configuration) = StartTetheringAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<NetworkOperatorTetheringOperationResult> StartTetheringAsync(NetworkOperatorTetheringSessionAccessPointConfiguration const& configuration);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<NetworkOperatorTetheringOperationResult> StartTetheringAsync(NetworkOperatorTetheringSessionAccessPointConfiguration configuration);
function startTetheringAsync(configuration)
Public Function StartTetheringAsync (configuration As NetworkOperatorTetheringSessionAccessPointConfiguration) As IAsyncOperation(Of NetworkOperatorTetheringOperationResult)

参数

configuration
NetworkOperatorTetheringSessionAccessPointConfiguration

NetworkOperatorTetheringSessionAccessPointConfiguration 对象,其中包含配置移动热点所需的所有每个会话字段。 此配置在会话之间不会保留。

返回

一个 对象,其中包含一个 TetheringOperationStatus 状态代码,该代码指示启动操作是否成功或失败的原因,以及包含附加错误消息(如果适用)的详细 HSTRING

属性

Windows 要求

设备系列
Windows 11 Insider Preview (在 10.0.26100.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v19.0 中引入)
应用功能
wiFiControl

适用于