locked
getting the CPU temperature RRS feed

  • Question

  • im trying to get the cpu temperature from the WMI but  i get errors. does this mean that the BIOS isnt sending it to the WMI? this is the code

    Private Sub mainform_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Dim moReturn As ManagementObjectCollection
            Dim moSearch As ManagementObjectSearcher
            Dim mo As Management.ManagementObject

            moSearch = New Management.ManagementObjectSearcher("Win32_TemperatureProbe")
            moReturn = moSearch.Get

            For Each mo In moReturn
                Trace.WriteLine(String.Format("{0} - {1}", mo("Name").ToString, mo("CurrentReading").ToString))
            Next
        End Sub


    I have tried replacing the "Current Reading" with "Caption" but it returns "Temperature Sensor" instaed of the temperature.
    I also read in MSDN library that the "CurrentReading" namespace hasnt been implemented and is reserved for future use, i gues thats why i get an error.

    is there any other way i can do this?
    Thursday, October 5, 2006 2:11 AM

Answers

  • I cant find a method in WMI to do so unfortunately....unless you need to do some calculations with the other properties, ill see what I can dig up
    Thursday, October 5, 2006 7:02 AM