Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/15.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/79.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 在“控制面板到组合框”中获取连接列表_Vb.net - Fatal编程技术网

Vb.net 在“控制面板到组合框”中获取连接列表

Vb.net 在“控制面板到组合框”中获取连接列表,vb.net,Vb.net,如何在控制面板中获取连接列表并将其输出到组合框 您可以使用: 要筛选网络连接中列出的内容,请执行以下操作: Dim niEthernet = ni.Where(Function(x) x.NetworkInterfaceType = Net.NetworkInformation.NetworkInterfaceType.Ethernet) 关于将它们放在组合框中,您需要决定它们应该如何显示。如果它只是每个组合框条目的连接名,则可以在不绑定数据

如何在控制面板中获取连接列表并将其输出到组合框

您可以使用:

要筛选网络连接中列出的内容,请执行以下操作:

Dim niEthernet = ni.Where(Function(x) x.NetworkInterfaceType =
                          Net.NetworkInformation.NetworkInterfaceType.Ethernet)
关于将它们放在组合框中,您需要决定它们应该如何显示。如果它只是每个组合框条目的连接名,则可以在不绑定数据的情况下执行:

For Each i In niEthernet
  ComboBox1.Items.Add(i.Name)
Next
ComboBox1.DataSource = niEthernet.Select(Function(x) x.Name).ToList()
或使用数据绑定:

For Each i In niEthernet
  ComboBox1.Items.Add(i.Name)
Next
ComboBox1.DataSource = niEthernet.Select(Function(x) x.Name).ToList()