Getting configuration settings from web.config/app.config using class library

后端 未结 4 1368
春和景丽
春和景丽 2020-12-09 18:48

Configuration settings in 3.5 is driving me nuts... Help! ;)

I have a class library (Named ADI), that needs some configuration settings from the project using it (li

4条回答
  •  甜味超标
    2020-12-09 18:59

    Add reference System.web; add name space and user

    using System.Web.Configuration;    
    
    String webConfigValue;
                webConfigValue = WebConfigurationManager.AppSettings["employeeDB"].ToString();
    

    to read the web config value

    
                    
    
    

提交回复
热议问题