我需要为我正在开发的应用程序收集一些系统信息。可用内存和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