C# Windows 8 XAML - Where add ApplicationData files?

127 views Asked by At

I have a very simple question. I'am trying load async some files which should be located in ApplicationData.Current.LocalFolder, but where is that directory? How I should add some files to this folder?

2

There are 2 answers

1
Khurram Hassan On BEST ANSWER

In Windows 7 or 8, it is located here (Assuming Windows is installed on C: drive):

C:\Users\<your_user_name>\AppData\Local

where <your_user_name> will be the currently Logged in username on the PC.

0
w.b On

You can't access this location directly, instead get a reference to it as a StorageFolder:

StorageFolder localFolder = ApplicationData.Current.LocalFolder;

then you can add or get a file:

StorageFile file = await localFolder.CreateFileAsync(fileName);

StorageFile file = await localFolder.GetFileAsync(filename)