地瓜皮的功效与作用:C#如何获取webconfig中的值

来源:百度文库 编辑:高校问答 时间:2024/05/12 15:38:15
我在webconfig中写了下面的数据库联接串
<add key="ConnStr" value="server=localhost;uid=sa;pwd=;Database=gzfdczz; TimeOut=30; "/>

用c#写联接怎么获得上面的连接串?????

string ConnStr=System.Configuration.ConfigurationSettings.AppSettings["ConnStr"];