Home > Backend Development > C++ > How Can Universal Windows Platform (UWP) Apps Access Files and Directories Outside Their Storage?

How Can Universal Windows Platform (UWP) Apps Access Files and Directories Outside Their Storage?

DDD
Release: 2025-01-09 22:07:45
Original
277 people have browsed it

How Can Universal Windows Platform (UWP) Apps Access Files and Directories Outside Their Storage?

File/Directory Access for Windows 10 Universal Apps

After migrating from WPF to Windows Universal Apps, access to files and directories outside the app storage is restricted.

Directory.Exists method is not available

UWP apps do not support the Directory.Exists method.

Access files outside of app storage

By default, UWP apps can only access certain directories and files:

  • Directories declared in the manifest file
  • User-selected directory via FileOpenPicker or FolderPicker
  • Files from FutureAccessList or MostRecentlyUsedList
  • Associate or share open files by file extension

Solution

Use FutureAccessList and FolderPicker:

  1. Declare the "futureAccessList" function in the app manifest.
  2. Use FolderPicker to allow the user to select a directory.
  3. Add directory to FutureAccessList.

Grant broad file system access (Windows 10, version 17134 and later):

  1. Declare the "broadFileSystemAccess" function in the app manifest.
  2. Submit your app to the App Store for review.
  3. If approved, the app will gain access to the entire file system based on user consent.

Additional notes:

  • FutureAccessList method remains valid after application restart.
  • The "broadFileSystemAccess" feature grants broad access and therefore requires additional review and runtime user consent.
  • Apps must be able to cope with access being denied.

The above is the detailed content of How Can Universal Windows Platform (UWP) Apps Access Files and Directories Outside Their Storage?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template