实时显示CPU温度 [英] Making CPU temperature real time
本文介绍了实时显示CPU温度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
好的..因此,经过很多努力,我设法通过WMI检索了CPU温度.但是,我的下一个问题是使温度成为实时温度.我什至不知道从哪里开始.有人可以指出我正确的方向吗?
谢谢,
Chris
Okay.. So after a lot of struggling I managed to retrieve the CPU temperature with WMI.. My next problem however, is making the temperature Real-Time.. I have no idea where to even begin. Can someone point me in the right direction?
Thanks,
Chris
推荐答案
您可以使用OpenHardwareMonitor
http://code.google.com/p/open-hardware-monitor/ [ ^ ]
http://openhardwaremonitor.org/support/ [ ^ ]
更新.
You can use OpenHardwareMonitor
http://code.google.com/p/open-hardware-monitor/[^]
http://openhardwaremonitor.org/support/[^]
upd.
// We have a ListBox named lbList
public void RefreshSensorData(){
this.lbList.Items.Clear();
OpenHardwareMonitor.Hardware.Computer computer = new OpenHardwareMonitor.Hardware.Computer();
// enabling CPU to monitor
computer.CPUEnabled = true;
computer.Open();
// enumerating all the hardware
foreach (OpenHardwareMonitor.Hardware.IHardware hw in computer.Hardware){
if (hw.HardwareType == OpenHardwareMonitor.Hardware.HardwareType.CPU){
hw.Update();
// searching for all sensors and adding data to listbox
foreach (OpenHardwareMonitor.Hardware.ISensor s in hw.Sensors){
if (s.SensorType != OpenHardwareMonitor.Hardware.SensorType.Temperature){
if (s.Value != null)
this.lbList.Items.Add(s.Value);
}
}
}
}
computer.Close();
}
您可以构建一个在计算机运行时启动的服务.这是一个服务示例: Windows服务应用程序 [ Ping监视器 [
You can build a service that starts up when the computer does. Here is a service sample: A Windows Service Application[^] or maybe use this article for a ping monitor: Ping Monitor[^]
这篇关于实时显示CPU温度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文