I'm receiving this error when the code look for the path, I dont understand whe this happend, I think im doing right.
Code:
string newUri = ImageGalleryUri.Replace("ms-appdatalocal/", ""); //Replace this part of the string with a nonspace character.
newUri = newUri.Replace("/", "\\");
newUri = newUri.Replace("%20", " "); //Replace the ASCII code for space for an actual space. For some reason I'm getting invalid character error with %20.
StorageFolder folder = Windows.Storage.ApplicationData.Current.LocalFolder;
StorageFile storageFile = await folder.GetFileAsync(newUri);
DataPackage dp = new DataPackage(); //Create the DataPackage containing the clipboard content.
dp.SetBitmap(RandomAccessStreamReference.CreateFromFile(storageFile));
Clipboard.SetContent(dp);
await successDialog.ShowAsync();
The error is in this line: newUri = ms-appdata:\local\Books\Assets\Recursos para el docente\Matematicas\9\Esp\1\0\Geometria_Page_04.png
StorageFile storageFile = await folder.GetFileAsync(newUri);
Maybe try this:
newUri = Uri.EscapeDataString(newUri);
Instead of:
newUri = newUri.Replace("%20", " ");
Create a file named file.txt and try this:
using Windows.Storage;
StorageFile file = await StorageFile.GetFileFromApplicationUriAsync("ms-appdata:///local/file.txt");
User contributions licensed under CC BY-SA 3.0