I searched a lot to get a solution with
OpenHardwareMonitor
but I also had no success. Furthermore in a lot of posts I found a remark that
OpenHardwareMonitor
is not a good tool, but this I can't jugde.
During these researches I found this easy solution with
WMI
which maybe can solve your request or at least a part of it:
using System.Management;
foreach (var item in new ManagementObjectSearcher("Select * from Win32_Processor").Get())
{
Log($"CurrentVoltage [V]: {(decimal.Parse(item["CurrentVoltage"].ToString()) /
10).ToString()}");
Log($"CurrentClockSpeed [GHz]: {(decimal.Parse(item["CurrentClockSpeed"].ToString()) /
1000).ToString()}");
}
Thanks to @Richard-MacCutchan, here a version without useless conversion to/from string:
foreach (var item in new ManagementObjectSearcher("Select * from Win32_Processor").Get())
{
Log($"CurrentVoltage [V]: {(ushort)item["CurrentVoltage"] / 10.0}");
Log($"CurrentClockSpeed [GHz]: {(uint)item["CurrentClockSpeed"] / 1000.0}");
}
[Edit]
One correction more after recognizing that
ManagementObjectSearcher
is
IDisposable
*grrr*
using (var managementObjectSearcher = new ManagementObjectSearcher("Select * from Win32_Processor"))
{
foreach (var item in managementObjectSearcher.Get())
{
Log($"CurrentVoltage [V]: {(ushort)(item["CurrentVoltage"]) / 10.0}");
Log($"CurrentClockSpeed [GHz]: {(uint)item["CurrentClockSpeed"] / 1000.0}");
}
}
[/Edit]
All properties which are available above you find here:
Win32_Processor class - Win32 apps | Microsoft Docs[
^]