跪求:VB获取CPU温度代码!!!
发布网友
发布时间:2022-04-21 00:17
我来回答
共2个回答
热心网友
时间:2023-10-03 05:56
Public Function GetCPUTemp() As Double
Dim i As Integer
Dim mCPU As Variant
Dim u As Variant
Dim s As String
Set mCPU = GetObject("WINMGMTS:{impersonationLevel=impersonate}!root\wmi").ExecQuery("SELECT CurrentTemperature From MSAcpi_ThermalZoneTemperature")
For Each u In mCPU
s = s & u.CurrentTemperature
Next
Set mCPU = Nothing
GetCPUTemp = (s - 2732) / 10
End Function
Private Sub Form_Load()
Timer1.Interval = 500
End Sub
Private Sub Timer1_Timer()
Print GetCPUTemp()
End Sub
热心网友
时间:2023-10-03 05:57
给你个链接
http://zhidao.baidu.com/question/65358529.html