?
Solved

CPU Temperature

Posted on 2006-06-02
2
Medium Priority
?
2,584 Views
Last Modified: 2009-05-15
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(query);
                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!
0
Comment
Question by:JoeDW
2 Comments
 
LVL 3

Accepted Solution

by:
gkatz earned 1000 total points
ID: 16819121
Try the C or C++ form, you'll have a much better chance of finding someone who knows how to do it.  That's a pretty low level process, I'd be suprised if C# had a direct way to do it.
0
 
LVL 1

Author Comment

by:JoeDW
ID: 16819386
That's what I was afraid of, thanks anyways!

Joe
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month15 days, 10 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question