Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

CPU Temp

I've been putting codes together to make a TaskManager so far it has processes and process kill CPU + RAM Usage, but I want to add a temperature label. I've tried different codes, but there not working. I heard you have to run it in Win Xp I did but still nothing I want to make it a label that refreshes in a timer, so can anyone tell/link me something that can help me thanks for using your time to read this.
This source has CPU temperature along with other pc stuff: https://hackforums.net/showthread.php?tid=3700586
Code
Function GetTemp() As String
Try
    Dim searcher As New ManagementObjectSearcher("root\WMI", "SELECT * FROM MSAcpi_ThermalZoneTemperature")
    For Each queryObj As ManagementObject In searcher.Get()
    Dim temp As Double = CDbl(queryObj("CurrentTemperature"))
    temp = (temp - 2732) / 10.0
  return temp.tostring()
    Next
  Catch ex As ManagementException
    MessageBox.Show(ex.Message)
return nothing
  End Try
End Function
Thanks guys got it down and it works


Possibly Related Threads...
Thread / Author Replies Views Last Post
by arul12Nov 23, 2023 10:10 AM 2 156 Nov 23, 2023 10:10 AM
Last Post: arul12
[C#] by autisticilabJan 12, 2018 10:34 AM 13 636 Jan 12, 2018 10:34 AM
Last Post: Ninja
[.NET] by NovaHowlDec 29, 2017 05:08 PM 5 247 Dec 29, 2017 05:08 PM
Last Post: NovaHowl