I am trying to get all the sensors that OpenHardwareMonitor can give. But i get almost all load type sensors ando not many temperature sensors:
This is my code:
{
Computer myComputer = new Computer();
myComputer = new Computer()
{
CPUEnabled =
true
};
myComputer.Open();
Trace.WriteLine("");
foreach (var hardwareItem in myComputer.Hardware)
{
if (hardwareItem.HardwareType == HardwareType.CPU)
{
hardwareItem.Update();
foreach (IHardware subHardware in hardwareItem.SubHardware)
subHardware.Update();
foreach (var sensor in hardwareItem.Sensors)
{
Debug.WriteLine(sensor.Name + " " + sensor.SensorType + " " + sensor.SensorType);
}
}
}
}
This is the result i get:
CPU Core #1 Load Load
CPU Core #2 Load Load
CPU Core #3 Load Load
CPU Core #4 Load Load
CPU Core #5 Load Load
CPU Core #6 Load Load
CPU Core #7 Load Load
CPU Core #8 Load Load
CPU Core #9 Load Load
CPU Core #10 Load Load
CPU Core #11 Load Load
CPU Core #12 Load Load
CPU Core #13 Load Load
CPU Core #14 Load Load
CPU Core #15 Load Load
CPU Core #16 Load Load
CPU Total Load Load
But i would like to get the CPU Temp and Volt, but i cant figure out a way to get them, also just to mention that if i use open hardware monitor app i can see all the sensors correctly.
Thanks so much for the help!
I have tried lots of tutorials, done the same in a subhardware loop but nothing shows up
Ive managed to fix it.
I was not implementing Ivisitor and LibreHardwareMonitor seems to be the updated version of the dll (i had to got it via nuget as it has to update some independeces)
Here i found the example code with the Ivisitor implemented: https://github.com/LibreHardwareMonitor/LibreHardwareMonitor