Reference to configuration manager via httpcontext
How can i get r开发者_如何学Goeference to the configuration manager via httpcontext?
Thanks
As pointed out by Adam, use:
System.Configuration.ConfigurationManager
It doesn't matter if it is in a class in a separate project. When you call the code from your web project, the ConfigurationManager will logic will be applied to your web app, not the containing project.
simply: System.Configuration.ConfigurationManager.AppSettings[""] (of course with a using stmt up top for System.Configuration - and make sure your library has a ref to system.configuration)
精彩评论