我想将一个文件从我的 Assets 文件夹复制到我的本地存储文件夹,我的代码可以工作,但是发生了一些奇怪的事情。
该文件位于正确的文件夹中,名称正确,但为空
是的。
我不明白为什么,我想问题不在我的代码中......我使用了一个从网络上获取的简单片段。
这是我的代码
StorageFolder InstallationFolder = Windows.ApplicationModel.Package.Current.InstalledLocation;
var myfiles = await InstallationFolder.GetFilesAsync(CommonFileQuery.OrderByName);
var myfile = myfiles.FirstOrDefault(x => x.Name.Contains("test"));
//if (myfiles != null) await ShowMessage(myfiles.ToString());
await myfile.CopyAsync(ApplicationData.Current.LocalFolder,"database.sqlite");
最佳答案
The file is in the correct folder, with the correct name, but is empty.
在检查您的代码之前,您是否已在 Asset 文件夹中设置了正确的文件属性?
尝试这样做
关于sqlite - 在 Windows Store App 中将 sqlite 文件从 Asset 复制到 LocalStorage,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24189306/