Reputation: 999
I have written this line of code:
file = await Package.Current.InstalledLocation.GetFileAsync("ms-appx:///Images/Hair Cuts/HC_1.jpg");
But it throws this exception:
WinRT information: An item cannot be found with the specified Name
(ms-appx:///Images/Hair Cuts/HC_1.jpg).
This image does exist in the specified folder. Can anyone help?
Upvotes: 1
Views: 2155
Reputation: 722
In order to retrieve the file, try using the code from the MSDN documentation:
using Windows.Storage;
.
StorageFile file = await StorageFile.GetFileFromApplicationUriAsync("ms-appx:///Images/Hair Cuts/HC_1.jpg");
Upvotes: 3