C# System.Configuration.ConfigurationManager.AppSettings["DB"]的解释

解释:
System.Configuration.ConfigurationManager.AppSettings["DB"]
b/s程序
从web.config配置文件中获取key值为"DB"的Value
c/s程序
从app.config配置文件中获取key值为"DB"的Value


作用:





string str = System.Configuration.ConfigurationManager.AppSettings[“config1”].ToString();
//str等于a
string str1 = System.Configuration.ConfigurationManager.AppSettings[“config2”].ToString();
//str1等于b

你可能感兴趣的:(C#)