I would like to read a few performance counters in my C# application, like "Processor\% Idle Time", but this 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With