File And Folder Locations

App Data

Private data that an app reads and writes.  Normally not directly exposed to users, and one app cannot view app data from another app.

When an app is uninstalled all of its app data automatically gets deleted as well.

There are two types:

app settings

Access available via the Windows.Storage.ApplicationData class.

Small, primitive values that are easy to store and retrieve.

app files

Access available via the Windows.Storage.ApplicationData class.

Regular files on the local file system but in a private location specific to your app. You can interact with app files without needing any capabilities.  

Security data (e.g. usernames and passwords)

Use PasswordVault for a secure srotage similar to app data but with security.  Even better, use WebAuthenticationBroker if you can.

Files That Were Packaged With Your App

	Windows.Storage.StorageFolder folder = Windows.ApplicationModel.Package.Current.InstalledLocation;
	Windows.Storage.StorageFile file = await folder.GetFileAsync("Assets\\SomeFile.txt");

Accessing Other Files

UWP applications can only use the KnownFolders for storage, no access is allowed to the wider core file system.

An exception to this is directories and files which the user manually selects with the FileOpenPicker or FolderPicker.

Accessing USB drive files

See here

 

 

Feel free to comment if you can add help to this page or point out issues and solutions you have found. I do not provide support on this site, if you need help with a problem head over to stack overflow.

Comments

Your email address will not be published. Required fields are marked *