简单的CPU温度解决方案 [英] Simple CPU temperature solution

查看:96
本文介绍了简单的CPU温度解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





你认识某人获取CPU温度的简单方法吗?

我知道互联网是很多解决方案,但是:



1基于WMI的解决方案但是我无法工作,温度是空的。

2打开硬件监视器太复杂了我的需求。



我需要一个平庸的Windows程序,显示文本框中的CPU温度,这就是全部。



感谢您的帮助!

Hey

Do you know someone a very simple way of getting the temperature of the CPU?
I know that the Internet is a lot of solutions, but:

1 Solutions based on WMI but I can not get work, the temperature is empty.
2 Open Hardware Monitor is too complicated for my needs.

I need a banal windows program that showed the CPU temperature in the textbox and that's all.

Thank you for any help!

推荐答案

从VB代码中快速基本搜索简单翻译:

Briefly translated from VB code in a quick basic search:
public class Form1
{
   private void Button1_Click(object sender, EventArgs e)
   {
      try {
         ManagementObjectSearcher searcher = new ManagementObjectSearcher(@"root\WMI", "SELECT * FROM MSAcpi_ThermalZoneTemperature");
         foreach (ManagementObject queryObj in searcher.Get()) {
            double temp = double.Parse(queryObj["CurrentTemperature"]);
            temp = (temp - 2732) / 10d;
            MessageBox.Show(temp.ToString());
      }
      catch (ManagementException err) {
         MessageBox.Show("An error occurred while querying for WMI data: " + err.Message);
      }
   }
}





WMI管理工具 [ ^ ]也可以提供很大的帮助。



WMI Administrative Tools[^] could be of great help, too.


这篇关于简单的CPU温度解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆