Private Function CPU_Temperature() As Integer
Dim WMIsvc As Object
Dim CltItems As Object, CltItem As Object
Dim Q As String
Set WMIsvc = GetObject("winmgmts:\\.\root\WMI")
Q = "SELECt * FROM MSAcpi_ThermalZoneTemperature"
Set CltItems = WMIsvc.ExecQuery(Q, , 48)
For Each CltItem In CltItems
CPU_Temperature = CltItem.CurrentTemperature
Next
CPU_Temperature = (CPU_Temperature - 2732) / 10
Set CltItem = Nothing
Set CltItems = Nothing
Set WMIsvc = Nothing
End Function
Private Sub Command1_Click()
Dim Unmber As Long
Unmber = CPU_Temperature + 32 * 1.8
Text1.Text = (CPU_Temperature & " ¡æ")
Text2.Text = (Unmber & "¨H")
End Sub
Private Sub Timer1_Timer(Index As Integer)
Dim Unmber As Long
Unmber = CPU_Temperature + 32 * 1.8
Text1.Text = (CPU_Temperature & " ¡æ")
Text2.Text = (Unmber & "¨H")
End Sub