I tryed to access files from an folder wich is located in the KnownFolder.Pictures folder, e.x. files from Pictures/Whatsapp. I want to create a StorageFolder, but from which path?
here is my code, which does not work
StorageFolder picturesFolder = await StorageFolder.GetFolderFromPathAsync("Data///Pictures//Whatsapp");
thanks in advance, Christian
Best How To :
PicturesLibrary is an virtual location - it exists both on Phone and SD card. So it's hard to tell the direct path as it may depend on user settings. You can access your folder like this:
StorageFolder pictures = KnownFolders.PicturesLibrary;
StorageFolder folder = await pictures.GetFolderAsync(@"Whatsapp"); // now you should have your folder
// to create a folder:
StorageFolder newOne = await folder.CreateFolderAsync(@"NewFolder", CreationCollisionOption.OpenIfExists);
Also remember to add suitable capabilities (PicturesLibrary) in your package.appxmanifest file.
As for your way - it is possible to get folder from direct path (if you had saved it before), but you have to give the complere path eg.
C:\Pictures... - but as I've said above, Pictures can also exist on SD card which has different letter.