views:

234

answers:

2

How to get the CPU Temperature info from Bios using c# I gave a try to the code in http://stackoverflow.com/questions/2923984/cpu-temperature-monitoring-c

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"

A: 

I would recommend the following approach. There are several free applications that monitor the CPU temp and display it. Try downloading some and then analyse the application to see what methods they are calling in order to discover how they work. Maybe they have a very different approach to your existing one. Also you might be able to just email them and ask how they did it...

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

http://www.techpowerup.com/realtemp/

http://malektips.com/core-temp-cpu-windows-system-tray-taskbar.html

Phil Wright
+2  A: 

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

Ernest