如何使用C#获取CPU温度

2024-12-14 06:33:15
推荐回答(2个)
回答1:

private void Form1_Load(object sender, EventArgs e)
{
timer1.Interval = 1000;
timer1.Enabled = true;
}

private void timer1_Tick(object sender, EventArgs e)
{
Double CPUtprt = 0;
ManagementObjectSearcher mos = new ManagementObjectSearcher(@"root\WMI", @"Select * From MSAcpi_ThermalZoneTemperature");
foreach (ManagementObject mo in mos.Get())
{
CPUtprt = Convert.ToDouble(Convert.ToDouble(mo.GetPropertyValue("CurrentTemperature").ToString()) - 2732) / 10;
textBox1.Text = ("CPU 温度 : " + CPUtprt.ToString() + " °C");
}

}

回答2:

你可以下载一个努大师、驱动精灵等等。其实在任务管理器里面也是有的。