在Windows上获得cpu%使用率和网络吞吐量的最有效和最基本的方法?

use*_*565 6 c# c++ windows wmi pdh

在Windows平台上获得cpu%使用率和网络吞吐量的最有效和最基本的方法是什么?

如我错了请纠正我...

  1. windows api // Win32?SDK?(c/c ++)#sorry,我不知道......
  2. Windows Management Instrumentation(WMI),
    • Win32_PerfFormattedData_Tcpip_NetworkInterface类BytesReceivedPerSec
    • Win32_PerfRawData_PerfOS_Processor类PercentProcessorTime
  3. System.Diagnostics PerformanceCounter
  4. 性能数据助手(PDH),pdh.dll
  5. PerformanceCounter(c#/ .net framework)或另一种nowaday方法?
  6. ntdll.dll中的 NtQuerySystemInformation

那么获取此值的最佳方法是什么,我是否只能导入windows.hkernel32.dll以获得cpu百分比使用率网络接口速度值?

谢谢

小智 1

在 C++ 中,我会使用PdhOpenQuery等... 不知道 C# 是否适用,但我猜 .NET 中有一些可用的东西PdhAddCounter