user3127031
user3127031

Reputation: 23

C# Windows 8 XAML - Where add ApplicationData files?

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?

Upvotes: 1

Views: 122

Answers (2)

w.b
w.b

Reputation: 11228

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)

Upvotes: 0

Khurram Hassan
Khurram Hassan

Reputation: 1544

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.

Upvotes: 2

Related Questions