title: How can I get the CPU temperature?
body: <p>I need to gather some system information for the application I'm developing. The memory available and the CPU load are easy to get using C#. Unfortunately, the CPU temperature it's not that easy. I have tried using WMI, but I couldn't get anything using</p>
  <pre><code>Win32_TemperatureProbe
  </code></pre>
  <p>or</p>
  <pre><code>MSAcpi_ThermalZoneTemperature
  </code></pre>
  <p>How can I do this? I'm wondering how monitoring programs, as SiSoftware Sandra, can get that information...</p>
  <p>Here is the code of the class:</p>
  <pre><code>public class SystemInformation
  {
      private System.Diagnostics.PerformanceCounter m_memoryCounter;
      private System.Diagnostics.PerformanceCounter m_CPUCounter;
  
      public SystemInformation()
      {
          m_memoryCounter = new System.Diagnostics.PerformanceCounter();
          m_memoryCounter.CategoryName = &quot;Memory&quot;;
          m_memoryCounter.CounterName = &quot;Available MBytes&quot;;
  
          m_CPUCounter = new System.Diagnostics.PerformanceCounter();
          m_CPUCounter.CategoryName = &quot;Processor&quot;;
          m_CPUCounter.CounterName = &quot;% Processor Time&quot;;
          m_CPUCounter.InstanceName = &quot;_Total&quot;;
      }
  
      public float GetAvailableMemory()
      {
          return m_memoryCounter.NextValue();
      }
  
      public float GetCPULoad()
      {
          return m_CPUCounter.NextValue();
      }
  
      public float GetCPUTemperature()
      {
          //...
          return 0;
      }
  }
  </code></pre>