简体   繁体   中英

Get a list of folders that my application has permission to access c# UWP

Is there a way to get a list of folders that my Application has permission to access, and how would I add a new folder to the list? For Example, Documents Folder, Picture Folder, etc.. etc.. And how to make this list of Folders persistent between application starts?

You can use KnownFolders static class to get common folders such as Documents, Pictures, etc. However, to be able to freely access them, you need to specify appropriate capabilities in your manifest (like 'Pictures Library', for example).

For any other arbitrary folder, you will need to explicitly ask user to pick it using FolderPicker . You can then save this folder for future access using FutureAccessList or MostRecentlyUsedList .

There is a good sample covering all those options in UWP samples repo .

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