简体   繁体   中英

How to require Windows 10 to index a USB key from a UWP app?

In Windows 10 it is possible to require the OS to index a specific location such as the D drive when a USB Key is inserted.

Is it possible to this in UWP ,and how?

The idea is to request permission from the user with a FolderPicker , and if granted, instruct the OS to index the location of the picked location. Thank you!

UWP does not currently provide APIs for indexing drive files.

File indexing is usually established when a user begins to access a file. As you have done, you can use FolderPicker to let the user pick the file and the system will create an index for it, but the UWP app cannot interfere with this process

Best regards.

StorageLibrary.RequestAddFolderAsync

here https://docs.microsoft.com/en-us/uwp/api/windows.storage.storagelibrary.requestaddfolderasync

This adds the folder to the library, which gets indexed, as desired. This seems to be the only possible solution as of now.

Credits to Peter Torr-MSFT

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM