获得CPU温度的函数

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
            DoEvents
  End Function
 
上一篇:LoadRunner 11压测时碰到错误Error: missing newline in E:\xx\RCV.dat


下一篇:Ubuntu VIM 及 ls 色彩设置