奇怪的网络设备
我正在使用 NetworkInformation 命名空间来列出所有网络设备。
NetworkInterface.GetAllNetworkInterfaces();
当我得到列表时,有一些奇怪的未知设备:
它们是什么?我应该、如果、那么如何摆脱它们?理论上它应该只显示本地连接和无线连接。在网络连接下我也找不到类似的安装内容。
I am using NetworkInformation namespace to list all the network devices.
NetworkInterface.GetAllNetworkInterfaces();
When I get the list, there are some weird unknown devices:
What are they? And should I, and if, then how, get rid of them? In theory it should show only Local Area Connection and Wireless Connection. Under Network Connections I can't find anything like that installed either.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Windows 拥有物理硬件上不存在的网络“设备” - 它们用于各种用途,例如 VPN 连接(如隧道伪接口)和环回适配器(它响应 127.0.0.1
)可以通过使用 WMI 查询适配器列表来解析非物理地址
(取自 MSDN),
这只会返回物理设备,因为您将 PhysicalAdapter 属性的 true/false 值转换为 bool。
Windows has network 'devices' that don't exist in terms of physical hardware - they're used for various things, such as VPN connections (like that tunneling pseudo interface) and the loopback adapter, which is what responds to 127.0.0.1
You can parse the non-physical addresses by using WMI to query the list of adapters instead,
(taken from MSDN)
That'll only return physical devices, as you're casting the true/false value of the PhysicalAdapter property as bool.
我相信诸如“本地连接* [数字]”之类的项目是由于虚拟机造成的(您是否正在运行虚拟PC或类似的东西?)。
环回适配器就在那里,因此您可以 ping 自己的 IP 地址,而无需插入网络(即到适配器并返回,而不使用本地主机或通过网络访问路由器/交换机并返回)。
恐怕其他人也不清楚。
I believe items such as "Local Area Connection* [number]" are due to VMs (are you running Virtual PC or something similar?).
The loopback adapter is there so you can ping your own IP address without being plugged into a network (i.e. to the adapter and back without using localhost or going to a router/switch and back over the network).
Not sure about the others, I'm afraid.