共用方式為


Radio.FromIdAsync(String) 方法

定義

擷取 Radio 物件的靜態方法。 方法接受透過 Windows.Devices.Enumeration.DeviceInformation.FindAllAsync找到的 'Device.Id'。 此程式比使用GetRadiosAsync取得無線電更可靠,在 USB 無線電在Windows 10工作站上失敗或移除的情況下取得無線電。 在此失敗或移除的無線電實例中, GetRadiosAsync 不會傳回任何藍牙無線電。 相反地,FindAllAsync會傳回可以傳遞至FromIdAsync的有效識別碼,以取得單選物件,其本身會回報為目前處於 'Disabled' 狀態。

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 物件。 否則,它會擲回例外狀況。

屬性

適用於