Radio.FromIdAsync(String) 方法

定义

检索 Radio 对象的静态方法。 方法接受通过 Windows.Devices.Enumeration.DeviceInformation.FindAllAsync 找到的“Device.Id”。 在 USB 无线电发生故障或Windows 10工作站上被删除的情况下,此过程比使用 GetRadiosAsync 获取无线电更可靠。 在此发生故障或已删除的无线电实例中, GetRadiosAsync 不返回任何蓝牙无线电。 相比之下,FindAllAsync 返回一个有效的 ID,该 ID 可以传递给 FromIdAsync 以获取单选对象,该单选对象将报告自身现在处于“已禁用”状态。

public:
 static IAsyncOperation<Radio ^> ^ FromIdAsync(Platform::String ^ deviceId);
/// [Windows.Foundation.Metadata.Overload("FromIdAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<Radio> FromIdAsync(winrt::hstring const& deviceId);
[Windows.Foundation.Metadata.Overload("FromIdAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<Radio> FromIdAsync(string deviceId);
function fromIdAsync(deviceId)
Public Shared Function FromIdAsync (deviceId As String) As IAsyncOperation(Of Radio)

参数

deviceId
String

Platform::String

winrt::hstring

标识特定无线电设备的字符串。

返回

异步检索操作。 成功完成后,它包含一个代表指定单选设备的 Radio 对象。 否则将引发异常。

属性

适用于