0

Firstly, sorry this beginner's question.

But i'm really don't know the concept of path

I want to save my image files on uwp's resources History folder that i created.

So that I can open that images or save them.

enter image description here

But i can't find a way how to access my own folder

I tried appdata.localfolder but that's not for me

Anyone know the solution to this?

Thank you for reading this !

Kay
  • 173
  • 14

1 Answers1

3

The images in the History folder are part of the program and are built to the package's installation directory. You can take it the equivalent of the C:\Program Files\Your App folder, the files are read-only.

To access the files from the History folder, use

var file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///History/yourfile.jpg"));

AppData.LocalFolder on the other hand, is your app's data folder, that is where the app data files - files that generated by the app - are located, and you can save app data there.

You can refer to this for how to write to the app data folder.

kennyzx
  • 12,845
  • 6
  • 39
  • 83
  • You can read it from the read only History folder, write to it, and save the modified version to the app data folder. The original version is always accessible from the History folder. How about that? – kennyzx Jun 15 '18 at 00:18