RE: Getting CPU Temperature 07-13-2013, 01:12 PM
#12
(07-13-2013, 12:43 PM)Madara-Uchiha Wrote: 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:
Wrong, First of all I've noticed all of that code is C&P'ed from here, so give propper credits. Secondly that won't fix my error? I've already coded it and I'm having trouble with the call back, and I set the application to <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> in the app manifest.
![[Image: OkXCq.gif]](http://i.imgur.com/OkXCq.gif)



![[Image: 3qmh7dfz.png]](http://s7.directupload.net/images/130713/3qmh7dfz.png)
![[+]](https://sinister.li/images/modern/collapse_collapsed.png)