DimaBond
DimaBond

Reputation: 61

Access the file system to my application UWP

I use the types StorageFile, StorageFolder and they need access to the file system, since the file is not opened by the user:

StorageFile storageFile = await StorageFile.GetFileFromPathAsync(filePath);

I need so that I can give the user permission to access the file system to my application:

Here is the picture - Access The File System

How can I do it?

Upvotes: 0

Views: 715

Answers (1)

Nico Zhu
Nico Zhu

Reputation: 32775

Your screenshot is app's access permission setting page, after add broadFileSystemAccess capability, your app will display in the list, you also need to manually enable broad file system in File System setting page. For getting the setting page, you could search file system keywords in setting app home page.

If you want to quickly access this page, you could use the following method. For more info please refer Launch the Windows Settings app.

bool result = await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings:privacy-broadfilesystemaccess")); 

For more info please refer uwp File access permissions.

Upvotes: 2

Related Questions