JoeDW
asked on
CPU Temperature
I have looked high and low for some example on how to get the CPU temperature or even MB temp in C#. I even looked into API calls but I cannot find any reference in kernel32 for temp sensor readings. I also tried WMI but to no avail. Maybe I am doing it wrong but this is what I have so far for WMI.
string query = "SELECT * FROM Win32_TemperatureProbe";
ManagementObjectSearcher moSearch = new ManagementObjectSearcher(q uery);
ManagementObjectCollection moCollection = moSearch.Get();
foreach (ManagementObject mo in moCollection)
{
txtLog.Text += mo["Caption"].ToString();
}
When debugging it never gets to the txtLog.Text line so it must have not collected anything. I know for a fact this system has temperature sensors for the CPU and motherboard. I do not mind API calls but if I could find out how to access it I would be a happy person.
Thanks for the help...anyone!
string query = "SELECT * FROM Win32_TemperatureProbe";
ManagementObjectSearcher moSearch = new ManagementObjectSearcher(q
ManagementObjectCollection
foreach (ManagementObject mo in moCollection)
{
txtLog.Text += mo["Caption"].ToString();
}
When debugging it never gets to the txtLog.Text line so it must have not collected anything. I know for a fact this system has temperature sensors for the CPU and motherboard. I do not mind API calls but if I could find out how to access it I would be a happy person.
Thanks for the help...anyone!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Joe