Deliver data in local storage on Windows 8

故事扮演 提交于 2019-12-13 18:07:23

问题


Is it possible to send some data already in the local storage in an Windows 8 app? I'm using a file based database in my project and want to deliever the whole database to the user so that I don't have to create all entries (more than 350).

You can find the data of the local storage in C:\Users\ username\AppData\Local\Packages, but there I cannot save information out of my app. Perhaps you have an idea.

Thanks.


回答1:


The way I did it in the past, to allow writing data to the file was...

  • Add the file as an asset.
  • on startup, check the local storage folder to see if the file exists.
  • If the file doesn't exist, copy it from the InstalledLocation to LocalFolder
  • perform IO as normal on the copied file.

If you then need to update the file from the web, you can download the new copy direct to the LocalFolder path for use, or parse it and add entries to the original file.



来源:https://stackoverflow.com/questions/12514220/deliver-data-in-local-storage-on-windows-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!