确定通过WMI网络适配器类型类型、网络适配器、WMI

2023-09-03 16:26:53 作者:烟雨梦兮

我使用WMI(Win32_NetworkAdapter这),并试图让连接的物理网络适配器有线或无线的细节,避免虚拟适配器等。

I'm using WMI (Win32_NetworkAdapter) and trying to get the details of attached physical network adapters either wired or wireless and avoid virtual adapters, etc.

读this文章,它解释说,你必须做的WMI一些聪明的查询,消除虚拟适配器并尝试只返回真正的物理适配器。

Reading this article it explains that you have to do some clever querying on WMI to eliminate virtual adapters and attempt to only return real physical adapters.

读this帖子它解释说,你可以将文本中的描述网络适配器进行比较,看它是否包含无线,802.11,或无线局域网,如果是的话,那么最有可能的适配器无线适配器。

Reading this post it explains that you can compare the text in the "Description" of the network adapter to see if it includes "Wireless", "802.11", or "WLAN", if it does, then most likely the adapter is a wireless adapter.

使用今天的.Net版本和其它进步,这些是真的在Windows XP +:确定一个网络适配器是有线或无线的,而不是从VM软件或类似的虚拟适配器的只有两种方式?如果没有,请解释。

With today's .Net versions and other advancements, are these really the only two ways of determining on Windows XP+ if a network adapter is wired or wireless and is not a virtual adapter from VM software or the like? If not, please explain.

推荐答案

也许这将帮助你 http://weblogs.sqlteam.com/mladenp/archive/2010/11/04/find-only-physical-network-adapters-with-wmi-win32_networkadapter-class.aspx确定通过WMI网络适配器类型,使用ManagementObjectSearcher类

maybe this will help you http://weblogs.sqlteam.com/mladenp/archive/2010/11/04/find-only-physical-network-adapters-with-wmi-win32_networkadapter-class.aspx to determine the Network Adapter Type via WMI ,using the ManagementObjectSearcher class