Silverlight 4 - 将用户设置保留到隔离存储

发布于 2024-09-08 18:46:36 字数 90 浏览 2 评论 0原文

完整的.NET平台有一个很棒的功能,可以在设置文件中存储用户选项,方便地支持保存和加载。有人为 Silverlight 创建过类似的东西吗?我希望将设置存储在客户端。

The full .NET platform has a great feature for storing user options in Settings files, which conveniently support saving and loading. Has anyone created an analog to this for Silverlight? I'd like the settings to be stored client side.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

后知后觉 2024-09-15 18:46:36

Silverlight 也有一个独立存储 API - 您可以通过字典以及独立存储中的完整文件系统 API 保存/检索离散元素。

  1. 创建一个可以通过 XML 序列化的类(使用 DataContractSerializer)
  2. 在关闭时序列化对象/在打开时反序列化对象。

Silverlight has an IsolatedStorage API as well - you can save/retrieve discrete elements via a dictionary as well as a full file system API in Isolated Storage.

  1. Create a class that can be serialized via XML (use the DataContractSerializer)
  2. Serialize object on close/Deserialize the object on open.
空袭的梦i 2024-09-15 18:46:36

您应该使用IsolatedStorageSettings。 (http://msdn.microsoft.com/en-us/library/system.io.isolatedstorage.isolatedstoragesettings(v=vs.95).aspx)

You should use the IsolatedStorageSettings. (http://msdn.microsoft.com/en-us/library/system.io.isolatedstorage.isolatedstoragesettings(v=vs.95).aspx)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文