Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 2.56 KB

storagedevice_fromid_114571398.md

File metadata and controls

31 lines (22 loc) · 2.56 KB
-api-id -api-type
M:Windows.Devices.Portable.StorageDevice.FromId(System.String)
winrt method

Windows.Devices.Portable.StorageDevice.FromId

-description

Gets a StorageFolder object from a DeviceInformation Id for a removable storage device.

-parameters

-param deviceId

The DeviceInformation ID that identifies the removable storage device. This id can be retrieved from Windows.Devices.Enumeration or the DeviceInformationId property of the AutoPlay device event arguments. For more information, see Quickstart: Register an app for an AutoPlay device. In order for FromId to succeed, the app must declare both the removableStorage capability as shown in the App capability declarations and file type associations for the files it wishes to access on the device as shown in How to handle file activation. For more information, see the Removable Storage sample.

-returns

The storage folder object that represents the removable storage device and provides access to content on the device.

-remarks

Pass the selector string from GetDeviceSelector to the Windows.Devices.Enumeration API to get a collection of DeviceInformation objects representing storage devices. Select the DeviceInformation object for the storage you want to access, and use its Id property as the deviceInformationId parameter to FromId.

-examples

-see-also

DeviceInformation, DeviceInformation.Id, Enumerating Common Devices

-capabilities

removableStorage