CustomDevice.FromIdAsync(String, DeviceAccessMode, DeviceSharingMode) 方法

定义

为指定的 DeviceInformation.Id 异步创建 CustomDevice 对象。

public:
 static IAsyncOperation<CustomDevice ^> ^ FromIdAsync(Platform::String ^ deviceId, DeviceAccessMode desiredAccess, DeviceSharingMode sharingMode);
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<CustomDevice> FromIdAsync(winrt::hstring const& deviceId, DeviceAccessMode const& desiredAccess, DeviceSharingMode const& sharingMode);
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<CustomDevice> FromIdAsync(string deviceId, DeviceAccessMode desiredAccess, DeviceSharingMode sharingMode);
function fromIdAsync(deviceId, desiredAccess, sharingMode)
Public Shared Function FromIdAsync (deviceId As String, desiredAccess As DeviceAccessMode, sharingMode As DeviceSharingMode) As IAsyncOperation(Of CustomDevice)

参数

deviceId
String

Platform::String

winrt::hstring

设备 的 DeviceInformation.Id

desiredAccess
DeviceAccessMode

所需访问权限。

sharingMode
DeviceSharingMode

共享模式。

返回

返回自定义设备。

属性

Windows 要求

应用功能
optical iot:lowLevelDevices

适用于