Search

just show me the code

Wednesday, February 25, 2009

Config Manager

abstract away from your code the fact that the configuration is coming from the web.config with ConfigManager class



    9     public static class ConfigManager
   10     {
   11         public static string GetSetting(string s)
   12         {
   13             return ConfigurationManager.AppSettings[s];
   14         }
   15     }

then

   58    ConfigManager.GetSetting("formcomplete")

will read from the webconfig here

   16   <appSettings>   
   25     <add key="formcomplete" value="formcomplete" /> 
   28   </appSettings>

No comments:

Post a Comment

Contributors