Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 如何读取app.config中的值列表并填充组合(VB)_Vb.net - Fatal编程技术网

Vb.net 如何读取app.config中的值列表并填充组合(VB)

Vb.net 如何读取app.config中的值列表并填充组合(VB),vb.net,Vb.net,我的app.config文件中有5个不同的ConnectionString,我想用这些值填充一个组合。如何在VB中实现这一点?使用循环并获得如下所有连接字符串 loop Start //add your desired code Web.Configuration.WebConfigurationManager.ConnectionStrings.Item(i) loop end 使用loop并获得如下所示的所有连接字符串 loop Start //add

我的app.config文件中有5个不同的ConnectionString,我想用这些值填充一个组合。如何在VB中实现这一点?

使用循环并获得如下所有连接字符串

   loop Start
   //add your desired code
   Web.Configuration.WebConfigurationManager.ConnectionStrings.Item(i)

   loop end

使用loop并获得如下所示的所有连接字符串

   loop Start
   //add your desired code
   Web.Configuration.WebConfigurationManager.ConnectionStrings.Item(i)

   loop end

添加对
System.Configuration dll
的引用。然后,您可以使用该类获取所有连接字符串:


我假设您不想显示完整的连接字符串,只想显示它的名称。

添加对
System.Configuration dll的引用。然后,您可以使用该类获取所有连接字符串:


我假设您不想显示完整的连接字符串,只想显示它的名称。

谢谢Tim。非常好谢谢你,蒂姆。煎得很好