Store user data in Windows 8 metro app

断了今生、忘了曾经 提交于 2019-12-09 14:50:55

问题


I am learning how to develop Windows 8 Metro style apps but i couldn't found a way to store user data in SQL Server for example.

What could i use or how to store user data.


回答1:


You cannot access local "desktop services" from the Metro app. So you will not be able to communicate with a local SQL Server. You can use online services that store your information or you can use local storage.

Take a look at:

  • How to store and retrieve local application data
  • ApplicationData sample

That question is also debated here and here




回答2:


You can use SQLite for Windows Runtime

Here is a blog post explaining how to use it:

http://timheuer.com/blog/archive/2012/08/07/updated-how-to-using-sqlite-from-windows-store-apps.aspx




回答3:


There are couple of ways of storing data - Roaming Settings (if you want the same data to be available across all the win8 devices he has installed your application), Application Settings in Isolated Storage. About storing data in SQL server, as you cannot deploy sql database with Metro app, you need to have a client-server arch to host your service in front of a sql server db.




回答4:


In addition to the answers you've already gotten, don't forget standard HTML5 localStorage, which should work across platforms and therefore help code reusability. What's not a standard is how much space you're allowed, but the de facto standard amount is about 5MB in all platforms. It might be more on Windows 8 for Metro style apps, but that's just a guess.



来源:https://stackoverflow.com/questions/8963307/store-user-data-in-windows-8-metro-app

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