在Windows 8上的本地存储中传送数据 [英] Deliver data in local storage on Windows 8

查看:158
本文介绍了在Windows 8上的本地存储中传送数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在Windows 8应用程式中的本机储存空间中传送一些资料?我在我的项目中使用基于文件的数据库,并希望将整个数据库交给用户,这样我就不必创建所有条目(超过350个)。

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).

您可以在C:\Users\ 用户名 \AppData\Local\Packages中找到本地存储的数据,但我无法从我的应用程序保存信息。或许你有一个想法。

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.

谢谢。

推荐答案

我是在过去,允许写入数据到文件是...

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


  • 将文件添加为资产。

  • 如果文件不存在,请将它从InstalledLocation复制到LocalFolder
  • / li>
  • 在复制的文件上执行IO。

  • 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.

如果您需要更新文件从网上,你可以直接下载新的副本到LocalFolder路径使用,或者解析它并添加条目到原始文件。

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.

这篇关于在Windows 8上的本地存储中传送数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆