![]() |
|
Getting CPU Temperature - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: Visual Basic & .NET Framework (https://sinister.ly/Forum-Visual-Basic-NET-Framework) +--- Thread: Getting CPU Temperature (/Thread-Getting-CPU-Temperature) Pages:
1
2
|
Getting CPU Temperature - Hexology - 07-13-2013 Okay well I'm completely stumped; I've been thinking about this for a while and all I can think of is using MSAcpi_ThermalZoneTemperature Class in the WMI, but my problem here is that not all CPU's support WMI Callbacks. Any ideas? Thanks. RE: Getting CPU Temperature - Eternity - 07-13-2013 I am also interested in getting my CPU(And GPU if possible) temperatures. RE: Getting CPU Temperature - Blue - 07-13-2013 Well, I have a GPU Meter for my graphics card that came with it. A long with fan speed and other stuff if you ahve GeForce or Nivida graphics card it will work.
RE: Getting CPU Temperature - Eternity - 07-13-2013 I think we both know that, we just want to know how to do it in .NET
RE: Getting CPU Temperature - Blue - 07-13-2013 (07-13-2013, 12:00 PM)Eternity Wrote: I think we both know that, we just want to know how to do it in .NET I'll throw one together real quick pretty easy to make. I'll post it for you guys!
RE: Getting CPU Temperature - Hexology - 07-13-2013 (07-13-2013, 12:03 PM)Blue Wrote:(07-13-2013, 12:00 PM)Eternity Wrote: I think we both know that, we just want to know how to do it in .NET It's alright I already coded one, its just that not everyone's PC supports callbacks from WMI RE: Getting CPU Temperature - Blue - 07-13-2013 (07-13-2013, 12:07 PM)Hexology Wrote:(07-13-2013, 12:03 PM)Blue Wrote:(07-13-2013, 12:00 PM)Eternity Wrote: I think we both know that, we just want to know how to do it in .NET Oh okay. Well yeah. RE: Getting CPU Temperature - Hexology - 07-13-2013 Here's what I mean Blue,
RE: Getting CPU Temperature - Blue - 07-13-2013 (07-13-2013, 12:20 PM)Hexology Wrote: Here's what I mean Blue, Oh yeah I understand now.
RE: Getting CPU Temperature - Madara-Uchiha - 07-13-2013 You can do it using WMI. Parse this code into your application, and make sure you've set a reference to System.Management. PHP Code: Imports System.Management
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
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
MessageBox.Show(temp.ToString + "°C")
Next
Catch err As ManagementException
MessageBox.Show("An error occurred while querying for WMI data: " & err.Message)
End Try
End Sub
End Class
Then start it as administrator and it will look like this:
|