[英]windres: The filename, directory name, or volume label syntax is incorrect
[英]The filename, directory name, or volume label syntax is incorrect. (Exception from HRESULT: 0x8007007B)
當代碼尋找路徑時,我收到此錯誤,我不明白這種情況發生的原因,我認為我做得對。
碼:
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();
錯誤在此行中: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);
也許試試這個:
newUri = Uri.EscapeDataString(newUri);
代替:
newUri = newUri.Replace("%20", " ");
創建一個名為file.txt的文件,然后嘗試以下操作:
使用Windows.Storage;
StorageFile文件=等待StorageFile.GetFileFromApplicationUriAsync(“ ms-appdata:///local/file.txt”);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.