如何将对象存储到Windows Phone 8.1 [英] How to Store Object to windows phone 8.1

查看:137
本文介绍了如何将对象存储到Windows Phone 8.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


在wp8.0中,我们可以将对象存储到IsolatedStorageSettings。 wp8.1对象没有存储。有没有办法将对象存储到wp8.1。

In wp8.0 we can store object to IsolatedStorageSettings. wp8.1 object was not storing. Is there any way to store object to wp8.1.


谢谢

推荐答案

将文件写入ApplicationData.Current.LocalFolder目录 以保存数据并将这些文件读回以加载数据。或者对于简单值(通常用于int,bools或字符串等设置),您还可以使用&ApplicationType.Current.LocalSettings。
如果你试图存储整个对象,那么在写出带有序列化对象的文件之前,你必须先将它们序列化。
Write files into the ApplicationData.Current.LocalFolder directory to save data and read those file back to load data. Or for simple values (commonly used for settings like ints, bools, or strings), you can also use ApplicationData.Current.LocalSettings. If you're trying to store entire objects, you're going to have to serialize them first before writing out a file with serialized object.


这篇关于如何将对象存储到Windows Phone 8.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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