簡體   English   中英

如何使用c#從Bios獲取CPU溫度信息?

[英]How to get the CPU Temperature info from Bios using c#?

如何使用c#從Bios獲取CPU溫度信息我嘗試了CPU溫度監控中的代碼

但是沒有運氣。 enumerator.Current 。Current拋出異常。

我怎樣才能做到這一點? 謝謝。

錯誤:

"This system doesn't support the required WMI objects(1) - check the exception file 
Not supported 

 at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
 at System.Management.ManagementObjectCollection.ManagementObjectEnumerator.MoveNext()
 at CedarLogic.WmiLib.SystemStatistics.RefreshReadings() in D:\Downloads\TempMonitorSrc\TemperatureMonitorSln\WmiLib\SystemStatistics.cs:line 25
 at CedarLogic.WmiLib.SystemStatistics.get_CurrentTemperature() in D:\Downloads\TempMonitorSrc\TemperatureMonitorSln\WmiLib\SystemStatistics.cs:line 87
 at TemperatureMonitor.SystemTrayService.CheckSupport() in D:\Downloads\TempMonitorSrc\TemperatureMonitorSln\TemperatureMonitor\SystemTrayService.cs:line 260"

我遇到了完全相同的問題:

https://superuser.com/questions/183282/cant-query-cpu-temperature-msacpi-thermalzonetemperature-on-windows-embedded-7

您引用的鏈接中的代碼正確。 我的.exe在Windows / XP和Windows / Vista上運行良好(只要我在Vista上“以管理員身份運行”)……但是由於Windows Embedded 7上出現WMI錯誤“不支持”而失敗。

此時,我不知道問題出在操作系統(WES7)還是主板(英特爾DH57jg)上。

盡管不理想,但我找到的最接近/最佳的解決方案是使用Speedfan (免費),它可以通過內存映射將其探測信息公開給外部應用程序。 有人完成了C#轉換:

使用C#讀取SpeedFan共享內存

“以我在上一篇文章中談到的內容為基礎,可以說我們想訪問C#應用程序提供的SpeedFan數據。此外,只能從內核中讀取SMBus和其他底層接口的信息。因此,諸如SpeedFan之類的應用程序(HWMonitor,Everest等)通常在內核級別運行驅動程序,然后在前端GUI上運行以顯示信息。

在使用SpeedFan的情況下,共享內存(實際上我認為它實際上是Windows上的內存映射文件)用於內核驅動程序和用戶空間GUI應用程序之間的通信。 更好的是,該文件的格式已由SpeedFan的作者公開。 因此,足夠多的討論,讓我們看一些代碼!”

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM