类库项目中,DB类如何获取AppConfig的内容 ?
DB获取AppConfig的链接字符串static string conStr = System.Configuration.ConfigurationManager.ConnectionStrings["localConnectionStringPay"].ToString();
AppConfig
程序代码:
<connectionStrings> <add name="localConnectionStringPay" connectionString="Server=192.168.1.37;Database=ZicTest;Uid=root;Pwd=root;"/> </connectionStrings>
注意:是在类库项目获取 ! 求大神解答 ,谢谢 !