如何要求 Windows 10 从 UWP 应用中索引 USB 密钥? [英] How to require Windows 10 to index a USB key from a UWP app?
问题描述
在 Windows 10 中,可以要求操作系统在插入 USB 密钥时索引特定位置,例如 D 驱动器.
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.
在 UWP 中可以做到这一点,以及如何做到这一点?
Is it possible to this in UWP ,and how?
这个想法是使用 FolderPicker
请求用户的许可,如果获得许可,则指示操作系统索引所选位置的位置.谢谢!
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!
推荐答案
StorageLibrary.RequestAddFolderAsync
这里 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.
感谢 Peter Torr-MSFT
Credits to Peter Torr-MSFT
这篇关于如何要求 Windows 10 从 UWP 应用中索引 USB 密钥?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!