How to get the CPU Temperature info from Bios using c#?

Anuya picture Anuya · Sep 1, 2010 · Viewed 10.7k times · Source

How to get the CPU Temperature info from Bios using c# I gave a try to the code in CPU temperature monitoring

But no luck. 'enumerator.Current' threw an exception.

How can i achieve this ? Thanks.

Error :

"This system doesn't support the required WMI objects(1) - check the exception file \r\nNot supported \r\n\r\n at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)\r\n at System.Management.ManagementObjectCollection.ManagementObjectEnumerator.MoveNext()\r\n at CedarLogic.WmiLib.SystemStatistics.RefreshReadings() in D:\Downloads\TempMonitorSrc\TemperatureMonitorSln\WmiLib\SystemStatistics.cs:line 25\r\n at CedarLogic.WmiLib.SystemStatistics.get_CurrentTemperature() in D:\Downloads\TempMonitorSrc\TemperatureMonitorSln\WmiLib\SystemStatistics.cs:line 87\r\n at TemperatureMonitor.SystemTrayService.CheckSupport() in D:\Downloads\TempMonitorSrc\TemperatureMonitorSln\TemperatureMonitor\SystemTrayService.cs:line 260"

Answer

Ernest picture Ernest · Sep 3, 2010

You need to support many diffrent hardware sensors to gather temperature data. Better way is to take ready to use solutions like these:

1) Open Hardware Monitor - open source .NET 2.0 Application:

http://openhardwaremonitor.org/

2) Core Temp - free application and .NET API to get temperature data:

http:// www.alcpu.com/CoreTemp/developers.html