如何从netstat -e等C/C++代码访问以太网统计信息?
Interface Statistics Received Sent Bytes 21010071 15425579 Unicast packets 95512 94166 Non-unicast packets 12510 7 Discards 0 0 Errors 0 3 Unknown protocols 0
Tomalak.. 6
WMI将提供这些读数:
SELECT * FROM Win32_PerfFormattedData_Tcpip_IP SELECT * FROM Win32_PerfFormattedData_Tcpip_TCP SELECT * FROM Win32_PerfFormattedData_Tcpip_UDP SELECT * FROM Win32_PerfFormattedData_Tcpip_ICMP SELECT * FROM Win32_PerfFormattedData_Tcpip_Networkinterface
这些类在Windows XP或更高版本上可用.您可能必须在Windows 2000上退出匹配的"Win32_PerfRawData"类,并在显示输出之前再做一些数学运算.
在MSDN中查找有关所有这些文档的文档.
WMI将提供这些读数:
SELECT * FROM Win32_PerfFormattedData_Tcpip_IP SELECT * FROM Win32_PerfFormattedData_Tcpip_TCP SELECT * FROM Win32_PerfFormattedData_Tcpip_UDP SELECT * FROM Win32_PerfFormattedData_Tcpip_ICMP SELECT * FROM Win32_PerfFormattedData_Tcpip_Networkinterface
这些类在Windows XP或更高版本上可用.您可能必须在Windows 2000上退出匹配的"Win32_PerfRawData"类,并在显示输出之前再做一些数学运算.
在MSDN中查找有关所有这些文档的文档.