如何通过 C# 中的代码从 web.config 中获取所有连接字符串的名称?
我试过这个:
System.Configuration.Configuration webConfig = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~");
ConnectionStringsSection x = webConfig.ConnectionStrings;
string here = x.SectionInformation.Name;