none
WMI Win32_TemperatureProbe CurrentReading=0

    Question

  • Hello, i have problem with reading a CPU temperature.

    CurentReading doesn't work and it shows that the temperature is -273,3 ( "temperatura") or -1 if I remove converting to Celsius. 

                    string compname = SystemInformation.ComputerName.ToString();
                    var query = new SelectQuery("Win32_TemperatureProbe");
                    var scope = new ManagementScope("\\\\" + compname + "\\root\\cimv2");
                    scope.Connect();
                    var mngmtSearcher = new ManagementObjectSearcher(scope, query);
                    double temperatura = -1;
                    foreach(var temp in mngmtSearcher.Get())
                    {
                        temperatura = Convert.ToDouble(temp.GetPropertyValue("CurrentReading").ToString());
                    }
                    temperatura = (temperatura - 2732) / 10.0;
                    label1.Text = "Temperatura je: " + temperatura.ToString();


    Thursday, April 27, 2017 11:39 PM

All replies

  • The documentation mentions that this field is not currently populated.

    Some articles recommend the MSAcpi_ThermalZoneTemperature WMI class.

    Friday, April 28, 2017 7:50 AM
  • Hello Viorel_ .

    I forgot to mention that if I use "MSAcpi_ThermalZoneTemperature" class, "CurrentTemperature" shows that the temperature is 0.


    Friday, April 28, 2017 3:14 PM