共用方式為


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

適用於