我需要爲我正在開發的應用程序收集一些系統信息。可用內存和CPU負載很容易使用C#。不幸的是,CPU溫度並不那麼容易。我一直在使用WMI嘗試,但使用如何獲得CPU溫度?
Win32_TemperatureProbe
或
MSAcpi_ThermalZoneTemperature
有沒有人已經處理了這個問題,我不能得到什麼嗎?我不知道如何監測方案,SiSoftware Sandra裏,可以得到的信息......
萬一有人有興趣,這裏是類的代碼:
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 = "Memory";
m_memoryCounter.CounterName = "Available MBytes";
m_CPUCounter = new System.Diagnostics.PerformanceCounter();
m_CPUCounter.CategoryName = "Processor";
m_CPUCounter.CounterName = "% Processor Time";
m_CPUCounter.InstanceName = "_Total";
}
public float GetAvailableMemory()
{
return m_memoryCounter.NextValue();
}
public float GetCPULoad()
{
return m_CPUCounter.NextValue();
}
public float GetCPUTemperature()
{
//...
return 0;
}
}
如果你願意付出我會去了解一下http://www.cpuid-pro.com如果我沒記錯的相同庫'Z-CPU `使用.. – Peter 2015-01-15 07:49:30