Login Register






Getting CPU Temperature filter_list
Author
Message
RE: Getting CPU Temperature #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:

[Image: 3qmh7dfz.png]

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]

Reply





Messages In This Thread
Getting CPU Temperature - by Hexology - 07-13-2013, 11:50 AM