System.UnauthorizedAccessException: 'Access to the path 'C:\' is denied.'
Rob has said Windows Store apps run sandboxed
and have very limited access to the file system in his blog. Access to other locations is available only through a broker process
. This broker process runs with the user’s full privileges.
So you could access the folder that mentioned by Stefan Wick with full privileges FolderPicker
.
Apps can access certain file system locations by default. Apps can also access additional locations by declaring capabilities.
There are some locations that all apps can access. Such as InstalledLocation
LocalFolder
.
StorageFolder localFolder = ApplicationData.Current.LocalFolder;
In addition to the default locations, an app can access additional files and folders by declaring capabilities in the app manifest. Such as Pictures
Music
library.
<Capabilities><uap:Capability Name="musicLibrary"/></Capabilities>
<Capabilities><uap:Capability Name="picturesLibrary"/></Capabilities>
For more, you could refer to File access permissions. And Skip the path: stick to the StorageFile will help you understand uwp file access in depth.