View Single Post
Old Jan 6th, 2008, 9:53 AM   #5
milot
Programmer
 
milot's Avatar
 
Join Date: Nov 2006
Location: Kosovė/Prishtinė
Posts: 47
Rep Power: 0 milot is on a distinguished road
Re: Temperature Controls

You can use WMI (Windows Management Instrumentation) Classes and use the Win32_TemperatureProbe WMI Class to get that information you need, here is a code snippet that shows how to use WMI on C#, you can easily convert this to VB:

the code:

csharp Syntax (Toggle Plain Text)
  1. using System;
  2. using System.Management;
  3. using System.Management.Instrumentation;
  4.  
  5. public class BClass
  6. {
  7.  
  8. public static void Main(string[] args)
  9. {
  10. ManagementObjectSearcher objectSearcher = new ManagementObjectSearcher("SELECT * FROM Win32_TemperatureProbe");
  11.  
  12. foreach (ManagementObject obj in objectSearcher.Get())
  13. Console.WriteLine(obj["Status"]);
  14. }
  15. }

You can use other properties as listed below:
http://msdn2.microsoft.com/en-us/lib...93(VS.85).aspx

but note that, you will need a bit of research because of the manufacturer drivers, on my laptop it doesn't work because I don't have appropriate drivers because I have an apple mac book so it doesn't show anything, but you can read here for more information:
http://groups.google.de/groups?q=cpu+temperature+dotnet

you can browse other WMI Classes to use for other purposes (see the list on the left)
milot is offline   Reply With Quote