I was using This Code...
//---Code---//
ManagementObjectSearcher mySearcher = new ManagementObjectSearcher("root\\WMI","SELECT * from Win32_TemparatureProbe");
foreach (ManagementBaseObject obj in mySearcher.Get())
{
if (obj == null)
{
label1.Text = "didn't find";
}
else
{
label1.Text = obj["Accuracy"].ToString ();
}
}
//---Code End---//
But No RESULT.
Plz me code for How to Get HardWare Information from CPU like Temparature,Voltage,FanSpeed. code in .Net
Thanks
AlanPosted Aug 8, 2008, 5:58 PM
I don't think you can get low level system info such as this unless the manufacturer has supplied a special WMI-compliant device driver with the machine. The WMI classes exist but without the device driver all the properties are null.
I did manage to get a value for the current temperature using Acpi:
using System;
using System.Management;
class Test
{
static void Main()
{
ManagementObjectSearcher mySearcher = new
ManagementObjectSearcher("root\\WMI","SELECT * from MSAcpi_ThermalZoneTemperature");
foreach (ManagementObject obj in mySearcher.Get())
{
if (obj == null)
{
Console.WriteLine("didn't find");
}
else
{
Console.WriteLine(obj["CurrentTemperature"].ToString());
}
}
}
}
This gave 2982 on my laptop which is in tenths of a degree Kelvin and so would equate to (2982 - 2732)/10 = 25 degrees celsius. However, I suspect this value may be hardcoded.
The only documentation I could find for the MSAcpi_ThermalZoneTemperature class is the following:
http://www.scriptinternals.com/new/us/support/Internal/WMI_MSAcpi_ThermalZoneTemperature.htm
madhu tPosted Aug 8, 2008, 4:01 PM
thanks
Ryan AlfordPosted Aug 8, 2008, 3:17 PM