Login Register






Thread Rating:
  • 0 Vote(s) - 0 Average


Getting CPU Temperature filter_list
Author
Message
RE: Getting CPU Temperature #11
(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.ObjectByVal e As System.EventArgsHandles 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]

Also, a Problem with that is if you have Visual Studio you can't set the Reference to that. Most people don't use it doe. : )
[Image: xlbdwZT.png]

Reply

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.ObjectByVal e As System.EventArgsHandles 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

RE: Getting CPU Temperature #13
@Hexology: Genius! I've never said that this is my code.
You can find the solution yourself by doing a quick google search.

Reply

RE: Getting CPU Temperature #14
(07-13-2013, 01:30 PM)Madara-Uchiha Wrote: @Hexology: Genius! I've never said that this is my code.
You can find the solution yourself by doing a quick google search.

I'm not quite sure you understand the error, the motherboard DOESN'T allow callbacks from WMI. I've been googling it, trust me, I can't find an answer anywhere. And you should ALWAYS give credits if you post someone else's code. Sorry if I'm being stern I just don't like it when people do that.
[Image: OkXCq.gif]

Reply

RE: Getting CPU Temperature #15
(07-13-2013, 01:35 PM)Hexology Wrote:
(07-13-2013, 01:30 PM)Madara-Uchiha Wrote: @Hexology: Genius! I've never said that this is my code.
You can find the solution yourself by doing a quick google search.

I'm not quite sure you understand the error, the motherboard DOESN'T allow callbacks from WMI. I've been googling it, trust me, I can't find an answer anywhere. And you should ALWAYS give credits if you post someone else's code. Sorry if I'm being stern I just don't like it when people do that.

Amen. Hm, Here if you just want a program to check it! Smile


http://dl.installiq.com/download/downloa...f=CoreTemp
[Image: xlbdwZT.png]

Reply

RE: Getting CPU Temperature #16
(07-13-2013, 02:02 PM)Blue Wrote:
(07-13-2013, 01:35 PM)Hexology Wrote:
(07-13-2013, 01:30 PM)Madara-Uchiha Wrote: @Hexology: Genius! I've never said that this is my code.
You can find the solution yourself by doing a quick google search.

I'm not quite sure you understand the error, the motherboard DOESN'T allow callbacks from WMI. I've been googling it, trust me, I can't find an answer anywhere. And you should ALWAYS give credits if you post someone else's code. Sorry if I'm being stern I just don't like it when people do that.

Amen. Hm, Here if you just want a program to check it! Smile


http://dl.installiq.com/download/downloa...f=CoreTemp

Thanks, I'm going to need to take a look at a lot of PC Optamizers because I'm trying to make one Wink It'll be my next project!
[Image: OkXCq.gif]

Reply

RE: Getting CPU Temperature #17
(07-13-2013, 02:29 PM)Hexology Wrote:
(07-13-2013, 02:02 PM)Blue Wrote:
(07-13-2013, 01:35 PM)Hexology Wrote:
(07-13-2013, 01:30 PM)Madara-Uchiha Wrote: @Hexology: Genius! I've never said that this is my code.
You can find the solution yourself by doing a quick google search.

I'm not quite sure you understand the error, the motherboard DOESN'T allow callbacks from WMI. I've been googling it, trust me, I can't find an answer anywhere. And you should ALWAYS give credits if you post someone else's code. Sorry if I'm being stern I just don't like it when people do that.

Amen. Hm, Here if you just want a program to check it! Smile


http://dl.installiq.com/download/downloa...f=CoreTemp

Thanks, I'm going to need to take a look at a lot of PC Optamizers because I'm trying to make one Wink It'll be my next project!

Sounds good! I made a simple CPU meter a while back. Smile
[Image: xlbdwZT.png]

Reply







Users browsing this thread: 2 Guest(s)