<connectionStrings> <add name="A" connectionString="A"/><add name="B" connectionString="B"/><add name="C" connectionString="C"/><add name="D" connectionString="D"/><add name="E" connectionString="e"/><add name="F" connectionString="f"/><add name="G" connectionString="g" /></connectionStrings> web.config 中有这么一组数据,请问在代码中怎么循环获取
1 回答
UYOU
TA贡献1878条经验 获得超4个赞
通过对 ConfigurationManager.ConnectionStrings 进行 foreach 操作得到 ConnectionStringSettings
foreach(ConnectionStringSettings css in ConfigurationManager.ConnectionStrings) { var connectionString = css.ConnectionString; }
- 1 回答
- 0 关注
- 329 浏览
添加回答
举报
0/150
提交
取消