简体   繁体   中英

How do I access performance counters from C# in Windows XP Embedded?

I have an application running under Windows XP, and I'm accessing the Processor and Memory performance counters. When I try to run the same code and access them on XP Embedded, the counters don't seem to be present. They are present in the image - I can see them all in perfmon. What's the missing piece here?

Have you added all the WMI components? As far as I know, you need all the WMI components to access the counters!

The Performance Counter Windows Management Instrumentation (WMI) Provider component provides a bridge between the performance registry interface and the WMI interface. This component allows WMI clients to access performance counters through WMI scripts, and allows management applications built using WMI to access performance counters. Without this component, applications must directly use the registry interface or the performance data helper interface to access performance counters.

Thank you TimK for the link ( http://msdn.microsoft.com/en-us/library/aa939695.aspx )

看来这就是我所缺少的: http : //msdn.microsoft.com/zh-cn/library/aa939695.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM