开发者

Using performance counters with different UI languages

开发者 https://www.devze.com 2023-01-22 19:23 出处:网络
I would like to read a few performance counters in my C# application, like \"Processor\\% Idle Time\", but th开发者_如何学Pythonis only works on English systems. Since performance counters need to be

I would like to read a few performance counters in my C# application, like "Processor\% Idle Time", but th开发者_如何学Pythonis only works on English systems. Since performance counters need to be initialized using the counter category and names, how can I make my code run under different UI languages?


After much searching, I found this MS KB article that explains how to retrieve the localized counter names using hard-coded index values: http://support.microsoft.com/kb/287159

Once you get the hard-coded index value from the registry, just pass it to the PdhLookupPerfNameByIndex method and it will return the localized counter name.

0

精彩评论

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