<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 中有這么一組數(shù)據(jù),請問在代碼中怎么循環(huán)獲取
1 回答

UYOU
TA貢獻1878條經(jīng)驗 獲得超4個贊
通過對 ConfigurationManager.ConnectionStrings 進行 foreach 操作得到 ConnectionStringSettings
foreach(ConnectionStringSettings css in ConfigurationManager.ConnectionStrings) { var connectionString = css.ConnectionString; }
- 1 回答
- 0 關注
- 350 瀏覽
添加回答
舉報
0/150
提交
取消