【发布时间】:2012-06-20 15:56:56
【问题描述】:
与 ipconfig/all 和 c# 系统调用相比,perfmon 计数器使用不同的 NIC 名称,如下所示(来自 ipconfig/all)
Ethernet adapter HHHH: Connection-specific DNS Suffix . : Description . . . . . . . . . . . : HP NC364T PCIe Quad Port Gigabit Server Adapter #3 Physical Address. . . . . . . . . : 00-1F-29-0D-26-59 DHCP Enabled. . . . . . . . . . . : No Autoconfiguration Enabled . . . . : Yes IPv4 Address. . . . . . . . . . . : 166.49.47.10(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.255.240 Default Gateway . . . . . . . . . : NetBIOS over Tcpip. . . . . . . . : Disabled
using System.Net.NetworkInformation;
NetworkInterface[] interfaces = NetworkInterface.GetAllNetworkInterfaces();
我收到HP NC364T PCIe Quad Port Gigabit Server Adapter #3。与 ipconfig 完全相同。
但是 perfmon 使用HP NC364T PCIe Quad Port Gigabit Server Adapter _3(下划线而不是哈希)。我是否必须使用不同的调用来获得与 perfmon 具有的完全相同的计数器名称?如果有,是什么?
【问题讨论】:
-
你也可以使用 WMI 获得
"HP NC364T PCIe Quad Port Gigabit Server Adapter #3"
标签: c# networking performancecounter