我正在尝试阅读 此处看到的网络适配器, 此时我正在使用我在网上找到的代码
Sub Main()
Dim path As ManagementPath = New ManagementPath()
path.Server = "."
path.NamespacePath = "root\CIMV2"
Dim scope As ManagementScope = New ManagementScope(path)
Dim query As ObjectQuery = New ObjectQuery("SELECT * FROM Win32_NetworkAdapter")
Dim searcher As ManagementObjectSearcher = New ManagementObjectSearcher(scope, query)
Dim queryCollection As ManagementObjectCollection = searcher.Get()
Dim m As ManagementObject
For Each m In queryCollection
Console.WriteLine("Device Name : {0}", m("Name"))
Next
Console.ReadLine()
End Sub
现在我看到了一个包含这 4 个设备的列表,还有一堆隐藏的设备以及看起来像不再连接的设备。如何优化搜索以仅显示设备管理器默认显示的内容?