简体   繁体   English

在 WP7 应用程序中存储配置值的最佳方式

[英]best way to store the configuration values in WP7 app

Since there is no default configuration file In a WP7 app, what is the best way to store the configuration values, eg DB connection strings, API Urls.由于在 WP7 应用程序中没有默认配置文件,存储配置值的最佳方式是什么,例如 DB 连接字符串、API Urls。 I want these values to be available easily and also updated easily.我希望这些值可以轻松获得并且也可以轻松更新。

Thanks谢谢

If the values are simple you could store them in the IsolatedStorageSettings class.如果这些值很简单,您可以将它们存储在IsolatedStorageSettings class 中。

If they get more complex, you could store them in a file (again in IsolatedStorage) with default values from within the code.如果它们变得更复杂,您可以使用代码中的默认值将它们存储在一个文件中(同样在 IsolatedStorage 中)。

You can also use http://sterling.codeplex.com/ , which kind of database.您也可以使用http://sterling.codeplex.com/ ,哪种数据库。 I use it in my Todoist Lite.我在我的 Todoist Lite 中使用它。 Works great for quering, saving, loading, etc. sets of data.非常适合查询、保存、加载等数据集。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM