相当于 ASP.NET Web.Config [英] Equivalent to ASP.NET Web.Config

查看:24
本文介绍了相当于 ASP.NET Web.Config的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Windows Phone 8 开发的新手.我来自 ASP.NET Web 窗体背景,其中设置存储在 Web.Config 中.正如你们中的一些人所知,Web.Config 设置本质上是分层的,其中值根据它们的位置(根 Web.config、machine.config、应用程序级别 Web.config)被覆盖

I'm new to Windows Phone 8 development. I'm coming from an ASP.NET Web Forms background where settings are stored in Web.Config. As some of you know, the Web.Config settings are hierarchical in nature where values are overridden depending on their location (root Web.config, machine.config, app level Web.config)

我正在创建一个调用第三方 API 的应用程序.第三方 API 使用需要个人密钥信息的 OAuth.我打算开源代码,所以我不想暴露这些密钥.

I am creating an app that calls into a third party API. The third party API uses OAuth which requires personal key information. I plan on open sourcing the code so I don't want to expose those keys.

如果这是 ASP.NET,我会将密钥存储在应用程序外部的 Web.config 文件中.这样,我就可以安全地向公众发布我的应用.

If this was ASP.NET, I'd store the keys in a Web.config file outside of the app. This way, I'd be safe to publish my app to the public.

我如何使用 Windows Phone 8 应用实现相同的效果?

How would I achieve the same with a Windows Phone 8 app?

推荐答案

App.config 功能在 Silverlight 和 WP 应用程序中不存在.您可以使用 IsolatedStorageSettings.ApplicationSettings 来保存/接收设置.

App.config functionality does not exist in Silverlight and WP apps. You can use IsolatedStorageSettings.ApplicationSettings to save/receive settings.

如果你仍然想使用类似于 App.config 的东西,那么你可以查看这个 link 类似的功能实现.

If you still want to use something similar to App.config then you can check this link for a similar functionality implementation.

这篇关于相当于 ASP.NET Web.Config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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