-api-id | -api-type |
---|---|
M:Windows.Devices.Portable.StorageDevice.FromId(System.String) |
winrt method |
Gets a StorageFolder object from a DeviceInformation Id for a removable storage device.
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.
The storage folder object that represents the removable storage device and provides access to content on the device.
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.
DeviceInformation, DeviceInformation.Id, Enumerating Common Devices
removableStorage