如何用c#获得cpu或hdd温度? [英] How to get cpu or hdd temperature with c#?

查看:95
本文介绍了如何用c#获得cpu或hdd温度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

api或wmi?



/////这是包..

api or wmi?

/////and this is package..

推荐答案

可能你不能。

从理论上讲,你可以使用WMI来获取它们,但是......

参见MSDN:Win32_TemperatureProbe类 [ ^ ]



Win32_TemperatureProbe WMI类提供的大部分信息来自SMBIOS。无法从SMBIOS表中提取CurrentReading属性的实时读数。因此,WMI的当前实现不会填充CurrentReading属性。当前读取属性的存在保留供将来使用。



这一切都依赖于BIOS,而WMI(等)依赖于主板制造商通过他们的驱动程序提供信息 - 和大多数人都不打扰,因为这不是必须这样做的。

如果驱动程序已经更新,那么下周在同一台PC上工作的PC可能无效!
Probably, you can't.
In theory, you can use WMI to get them, but...
See MSDN: Win32_TemperatureProbe class[^]

"Most of the information that the Win32_TemperatureProbe WMI class provides comes from SMBIOS. Real-time readings for the CurrentReading property cannot be extracted from SMBIOS tables. For this reason, current implementations of WMI do not populate the CurrentReading property. The CurrentReading property's presence is reserved for future use."

It's all dependant on the BIOS, and WMI (et al) rely on motherboard manufacturers providing that info via their drivers - and most don't bother because it's not compulsory to do so.
So what works on one PC may not work next week on the same PC if the drivers have been updated!

您可以查看打开硬件监视器 [ ^ ]。源代码可供下载。
You could take a look at Open Hardware Monitor[^]. The source code is available for download.


这篇关于如何用c#获得cpu或hdd温度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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