开发者

using mfc to get process network statistics

开发者 https://www.devze.com 2023-01-31 15:39 出处:网络
Now I\'am working on a MFC program. What I want to know is the speed a process receive/send to the network. Suppose I have a process named chrome.exe, it may receive 1008B/s, send 2987B/s. I know I ca

Now I'am working on a MFC program. What I want to know is the speed a process receive/send to the network. Suppose I have a process named chrome.exe, it may receive 1008B/s, send 2987B/s. I know I can get what I want in the Win 7 Resource Monitor. But how can I get those data in my program. Dose MFC or Win32api support th开发者_如何学Gois?


You can obtain this information, as well as a wealth of other performance data using WMI:

Monitoring Performance Data

This class is probably what you are looking for:

Win32_PerfFormattedData_Tcpip_NetworkInterface

From a native C++/MFC application, you'll access WMI through some COM interfaces

Have fun!

0

精彩评论

暂无评论...
验证码 换一张
取 消