请参阅以下代码:
Public Shared Sub SyncConnectionStrings() Dim strCon As String Dim tyDatabase As typeDatabase Dim boolConfigChanged As Boolean 'Dim config As System.Configuration.Configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None) Dim config As Configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None) Dim strConnectionString As ConnectionStringSettings For Each strConnectionString In ConfigurationManager.ConnectionStrings 'More code here,but irrelevant for this question. Next End Sub
代码循环遍历app.config文件中的所有连接字符串. app.config中有三个连接字符串,但找到了四个连接字符串.其中:LocalsqlServer(这是ConfigurationManager.ConnectionStrings.Name)定义了什么?