title: Get CPU Temperature using Open Hardware Monitor
body: <p>I am trying to use the OpenHardwareMonitorLib DLL to get the temperature of my CPU \ cores, however this doesn't return the temperature for me. </p>
  
  <p>I have looked around and seen that this is a problem almost everywhere but I cannot get this to work. </p>
  
  <p>I would be very appreciative if someone can tell me where I am going wrong with this. </p>
  
  <p>This is my code:</p>
  
  <pre><code>using System;
  using System.Linq;
  using System.Management;
  using OpenHardwareMonitor.Collections;
  using OpenHardwareMonitor.Hardware;
  using OxyPlot;
  using OxyPlot.Series;
  
  
  namespace cs_TempReader
  {
      class Program
      {
          private DateTime now;
          protected readonly ListSet&lt;ISensor&gt; active = new ListSet&lt;ISensor&gt;();
          public event SensorEventHandler SensorAdded;
          public event SensorEventHandler SensorRemoved;
  
          protected virtual void ActivateSensor(ISensor sensor)
          {
              if (active.Add(sensor))
                  if (SensorAdded != null)
                      SensorAdded(sensor);
          }
  
          private static void Main(string[] args)
          {
              var myComputer = new Computer();
  
              myComputer.CPUEnabled = true;
              myComputer.ToCode();
              myComputer.Open();
  
              foreach (var hardwareItem in myComputer.Hardware)
              {
                  hardwareItem.Update();
                  hardwareItem.GetReport();
  
                  Console.WriteLine(hardwareItem.GetReport());
  
                  var series = new LineSeries();
  
                  foreach (var sensor in hardwareItem.Sensors)
                  {
                      if (sensor.SensorType == SensorType.Temperature)
                      {
                          Console.WriteLine("{0} {1} {2} = {3}", sensor.Name, sensor.Hardware, sensor.SensorType, sensor.Value);
  
                      }
  
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>My ultimate goal is to be able to tie this into a bigger application. </p>