windows-phone-8 – 在Windows Phone 8中存储配置值/设置的最佳
发布时间:2020-12-14 01:56:21 所属栏目:Windows 来源:网络整理
导读:由于没有默认配置文件在WP8应用程序中,存储配置值的最佳方法是什么,例如: WCF服务URL,用户名和密码.我希望这些值在手机重启和app关闭时可用并可更新. 提前致谢. 解决方法 您应该使用IsolatedStorageSettings.ApplicationSettings. 保存价值: IsolatedStora
由于没有默认配置文件在WP8应用程序中,存储配置值的最佳方法是什么,例如: WCF服务URL,用户名和密码.我希望这些值在手机重启和app关闭时可用并可更新.
提前致谢. 解决方法
您应该使用IsolatedStorageSettings.ApplicationSettings.
保存价值: IsolatedStorageSettings appSettings = IsolatedStorageSettings.ApplicationSettings; appSettings.Add("email","someone@contoso.com"); appSettings.Save(); 加载值: IsolatedStorageSettings appSettings = IsolatedStorageSettings.ApplicationSettings; string val = (string)appSettings["email"]; 请参阅此处的MSDN教程:How to: Store and Retrieve Application Settings Using Isolated Storage.它是一个桌面Silverlight教程,但它在Windows Phone中的工作方式相同. 编辑: 如果您的应用使用后台代理,则使用IsolatedStorageSettings.ApplicationSetting可能会出现问题(感谢@RichardSzalay获取信息). 如果您的代理仅读取,则建议使用带有互斥锁的IsolatedStorageSettings.ApplicationSettings. 资料来源:Background agent best practices for Windows Phone (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- Windows下nginx的启动,重启,关闭功能
- windows-server-2003 – 是否有Windows 2003 Server Servic
- Windows防火墙netsh阻止文本文件中的所有ips
- windows-phone-7 – 如何检查列表的数据绑定何时完成? (WP
- windows – 将“Everyone”组添加到目录及其所有子目录中
- 从导入的DLL调用Metatrader MQL4 / MQL5函数
- 是否有可能在Windows Azure中拥有Git仓库?
- windows – 转换Mercurial存储库中的行尾模式
- Windows 2019 激活教程
- windows – 使用“Run as …”作为受限用户修改网络连接设置
推荐文章
站长推荐
- Windows安装程序 – 通过互联网更新MSI安装的最佳
- windows-server-2008-r2 – RemoteApp .rdp嵌入信
- windows7+docker+mysql5.6配置
- windows – NTFS:用户可以编辑/删除没有权限的文
- Scoop - 在Windows命令行上进行程序安装
- Windows Azure VM远程桌面连接问题
- 拥有一个充满旧东西的注册表是否会减慢Windows的
- Windows – Outlook 2003(使用Exchange 2007)错误
- 如何为Windows资源管理器搜索UI编写自定义搜索提
- .net – 没有WebBrowser控件的Windows.Forms中的
热点阅读