![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Hobbyist Programmer
|
Temperature Controls
Hi,
I'm wanting to make a temperature monitoring application like speedfan or coretemp and was just wondering how to monitor the temperature. Is there a certain control - I've tried googling for a class or something and I just can't find anything. Thanks very, very much! Matt. I |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
|
Re: Temperature Controls
do you actualy want to interface with hardware?
__________________
i dont know much about programming but i try to help |
|
|
|
|
|
#3 |
|
Hobbyist Programmer
|
Re: Temperature Controls
Yes, I think it would be nice. Why would you not recommend it? Is there something bad I'm missing?
Thanks for the reply! |
|
|
|
|
|
#4 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,799
Rep Power: 5
![]() |
Re: Temperature Controls
Here's a link to a discussion about how to do it in Linux. Although you're not doing this in Linux, I'm sure that either some of the libraries are cross-compatible and/or you can use this thread as a stepping stone to finding the correct library.
Good luck. |
|
|
|
|
|
#5 |
|
Programmer
Join Date: Nov 2006
Location: Kosovė/Prishtinė
Posts: 47
Rep Power: 0
![]() |
Re: Temperature Controls
You can use WMI (Windows Management Instrumentation) Classes and use the Win32_TemperatureProbe WMI Class to get that information you need, here is a code snippet that shows how to use WMI on C#, you can easily convert this to VB:
the code: csharp Syntax (Toggle Plain Text)
You can use other properties as listed below: http://msdn2.microsoft.com/en-us/lib...93(VS.85).aspx but note that, you will need a bit of research because of the manufacturer drivers, on my laptop it doesn't work because I don't have appropriate drivers because I have an apple mac book so it doesn't show anything, but you can read here for more information: http://groups.google.de/groups?q=cpu+temperature+dotnet you can browse other WMI Classes to use for other purposes (see the list on the left) |
|
|
|
|
|
#6 |
|
Hobbyist Programmer
|
Re: Temperature Controls
Thanks! The C# was helpful!
There are two ways (almost the same) I managed to find (with some help) in VB.NET: Imports System
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)
' Next
'Catch ex As ManagementException
' MessageBox.Show(ex.Message)
'End Try
Dim tempReturn As Management.ManagementObjectCollection
Dim tempSearch As Management.ManagementObjectSearcher
Dim temp As Management.ManagementObject
Dim StrOut As String
tempSearch = New Management.ManagementObjectSearcher("root\cimv2", "Select * from Win32_TemperatureProbe")
tempReturn = tempSearch.Get
For Each mo In tempReturn
StrOut = StrOut & " " & mo("Name") & " " & mo("CurrentReading")
Next
MsgBox(StrOut)
End Sub
End ClassUnfortunately, they don't work for me either. Is there any way that you know that I can get the drivers to make them work/include them in the application? Thanks! Matt. I |
|
|
|
|
|
#7 |
|
Programmer
Join Date: Nov 2006
Location: Kosovė/Prishtinė
Posts: 47
Rep Power: 0
![]() |
Re: Temperature Controls
Well I did a bit of research on "why-wmi-doesn't-support-Win32_TemperatureProbe" and figured out that WMI doesn't support this feature right now, but it will in the near future, but I saw that this guy -> http://geekswithblogs.net/cicorias/a.../22/97855.aspx wrote a little software for temperature monitor and you can download its source code, but I downloaded the installer and when I open the main assembly it throws an exception see the picture below:
![]() because he used the same techniques that we discussed above this post. So keep googling and if you find something useful, notify us, in meantime I will try finding the solution and will reply for notification. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Temperature monitoring - Harware | Wizard1988 | Coder's Corner Lounge | 6 | Jul 18th, 2007 3:12 PM |
| How to create office xp like menus and other custom controls | some1 | C++ | 5 | Nov 8th, 2005 2:28 PM |
| Question about loading controls | Benoit | Visual Basic | 2 | Sep 20th, 2005 2:01 AM |
| Determining a client computer's core temperature | Kami | ASP | 2 | Jul 17th, 2005 2:44 AM |
| Temperature Conversion Program - Help! | shangnyun | Java | 32 | Jun 12th, 2005 8:31 AM |