472,354 Members | 2,065 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,354 software developers and data experts.

CPU Temperature

One the computer I am programmig I could see the CPU temperature in the
BIOS, is there a system DLL in VB.NET that I can call to display the
temperature in my software?

Thanks!
Nov 21 '05 #1
5 32093
"anthony" <an*******@controlengineer.com> schrieb:
One the computer I am programmig I could see the CPU temperature in the
BIOS, is there a system DLL in VB.NET that I can call to display the
temperature in my software?


<URL:http://www.google.es/groups?q=Win32_TemperatureProbe+dotnet+-herfried>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #2
Anthony,

You can use WMI if your hardware is compliant. Use the wbemtest.exe
utility to confirm whether or not you can even retrieve the
temperature. There are two ways I know of to retrieve the temperature
information.

1) Using wbemtest.exe connect to the namespace "root\cimv2" (without
quotes). Click the Query button and enter "select * from
Win32_TemperatureProbe". Double click on any result you get back and
look for the CurrentReading property in the properties section. The
value you see there should be the temperature. If it just shows
"<null>" then this option will not work.

2) Using wbemtest.ext connect to the namespace "root\WMI". Enter the
query "select * from MSAcpi_ThermalZoneTemperature". Double click on
any result you get back and look for the CurrentTemperature property.
The value is in tenths of degrees Kelvin.

Using #2 I can see that I have 3 temperature probes in my laptop. I
can view their values in .NET using the following code. I apologize in
advance for using C# in VB forum.

// Reference the System.Management.dll assembly first.
using System.Management;

public class Temperature
{
public static void Main()
{
string scope = @"root\WMI";
string query = @"select * from MSAcpi_ThermalZoneTemperature";

ManagementObjectSearcher searcher = new
ManagementObjectSearcher(scope, query);

foreach (ManagementObject obj in searcher.Get())
{
Console.WriteLine(obj.Properties["CurrentTemperature"].Value);
}
}
}

Brian

anthony wrote:
One the computer I am programmig I could see the CPU temperature in
the BIOS, is there a system DLL in VB.NET that I can call to
display the temperature in my software?

Thanks!


Nov 21 '05 #3
Thanks,

I am able to use the following VB.NET code to get the temperature in my
development machine, but when I run in a XP Embedded machine, I got
"Provider Load Failure" error message for the first button, and "Invalid
parameter" for the second one. Any idea? Thanks for your knowledge!

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click

Dim moReturn As Management.ManagementObjectCollection

Dim moSearch As Management.ManagementObjectSearcher

Dim mo As Management.ManagementObject

Dim StrOutput As String

moSearch = New Management.ManagementObjectSearcher("root\cimv2", "Select *
from Win32_TemperatureProbe")

moReturn = moSearch.Get

For Each mo In moReturn

StrOutput = StrOutput & " " & mo("Name") & " " & mo("CurrentReading")

Next

MsgBox(StrOutput)

End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button5.Click

Dim moReturn As Management.ManagementObjectCollection

Dim moSearch As Management.ManagementObjectSearcher

Dim mo As Management.ManagementObject

Dim StrOutput As String

moSearch = New Management.ManagementObjectSearcher("root\WMI", "Select *
from MSAcpi_ThermalZoneTemperature")

moReturn = moSearch.Get

For Each mo In moReturn

StrOutput = StrOutput & " " &
Convert.ToString(Convert.ToUInt32(mo("CurrentTempe rature")))

Next

MsgBox(StrOutput)

End Sub

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:ei**************@TK2MSFTNGP15.phx.gbl...
"anthony" <an*******@controlengineer.com> schrieb:
One the computer I am programmig I could see the CPU temperature in the
BIOS, is there a system DLL in VB.NET that I can call to display the
temperature in my software?

<URL:http://www.google.es/groups?q=Win32_TemperatureProbe+dotnet+-herfried>
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4
I am able to use the following VB.NET code to get the temperature in my
development machine, but when I run in a XP Embedded machine, I got
"Provider Load Failure" error message for the first button, and "Invalid
parameter" for the second one. Any idea? Thanks for your knowledge!

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click

Dim moReturn As Management.ManagementObjectCollection

Dim moSearch As Management.ManagementObjectSearcher

Dim mo As Management.ManagementObject

Dim StrOutput As String

moSearch = New Management.ManagementObjectSearcher("root\cimv2", "Select *
from Win32_TemperatureProbe")

moReturn = moSearch.Get

For Each mo In moReturn

StrOutput = StrOutput & " " & mo("Name") & " " & mo("CurrentReading")

Next

MsgBox(StrOutput)

End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button5.Click

Dim moReturn As Management.ManagementObjectCollection

Dim moSearch As Management.ManagementObjectSearcher

Dim mo As Management.ManagementObject

Dim StrOutput As String

moSearch = New Management.ManagementObjectSearcher("root\WMI", "Select *
from MSAcpi_ThermalZoneTemperature")

moReturn = moSearch.Get

For Each mo In moReturn

StrOutput = StrOutput & " " &
Convert.ToString(Convert.ToUInt32(mo("CurrentTempe rature")))

Next

MsgBox(StrOutput)

End Sub

"Brian Gideon" <br*********@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Anthony,

You can use WMI if your hardware is compliant. Use the wbemtest.exe
utility to confirm whether or not you can even retrieve the
temperature. There are two ways I know of to retrieve the temperature
information.

1) Using wbemtest.exe connect to the namespace "root\cimv2" (without
quotes). Click the Query button and enter "select * from
Win32_TemperatureProbe". Double click on any result you get back and
look for the CurrentReading property in the properties section. The
value you see there should be the temperature. If it just shows
"<null>" then this option will not work.

2) Using wbemtest.ext connect to the namespace "root\WMI". Enter the
query "select * from MSAcpi_ThermalZoneTemperature". Double click on
any result you get back and look for the CurrentTemperature property.
The value is in tenths of degrees Kelvin.

Using #2 I can see that I have 3 temperature probes in my laptop. I
can view their values in .NET using the following code. I apologize in
advance for using C# in VB forum.

// Reference the System.Management.dll assembly first.
using System.Management;

public class Temperature
{
public static void Main()
{
string scope = @"root\WMI";
string query = @"select * from MSAcpi_ThermalZoneTemperature";

ManagementObjectSearcher searcher = new
ManagementObjectSearcher(scope, query);

foreach (ManagementObject obj in searcher.Get())
{
Console.WriteLine(obj.Properties["CurrentTemperature"].Value);
}
}
}

Brian

anthony wrote:
One the computer I am programmig I could see the CPU temperature in
the BIOS, is there a system DLL in VB.NET that I can call to
display the temperature in my software?

Thanks!

Nov 21 '05 #5
Hi,

When you look at the supported operating systems for
win32_temperatureprobe I see windows xp. I do not see xp embedded.

http://msdn.microsoft.com/library/de...atureprobe.asp
Ken
------------------
"anthony" <an*******@controlengineer.com> wrote in message
news:OO**************@TK2MSFTNGP09.phx.gbl...
I am able to use the following VB.NET code to get the temperature in my
development machine, but when I run in a XP Embedded machine, I got
"Provider Load Failure" error message for the first button, and "Invalid
parameter" for the second one. Any idea? Thanks for your knowledge!

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click

Dim moReturn As Management.ManagementObjectCollection

Dim moSearch As Management.ManagementObjectSearcher

Dim mo As Management.ManagementObject

Dim StrOutput As String

moSearch = New Management.ManagementObjectSearcher("root\cimv2", "Select *
from Win32_TemperatureProbe")

moReturn = moSearch.Get

For Each mo In moReturn

StrOutput = StrOutput & " " & mo("Name") & " " & mo("CurrentReading")

Next

MsgBox(StrOutput)

End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button5.Click

Dim moReturn As Management.ManagementObjectCollection

Dim moSearch As Management.ManagementObjectSearcher

Dim mo As Management.ManagementObject

Dim StrOutput As String

moSearch = New Management.ManagementObjectSearcher("root\WMI", "Select *
from MSAcpi_ThermalZoneTemperature")

moReturn = moSearch.Get

For Each mo In moReturn

StrOutput = StrOutput & " " &
Convert.ToString(Convert.ToUInt32(mo("CurrentTempe rature")))

Next

MsgBox(StrOutput)

End Sub

"Brian Gideon" <br*********@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Anthony,

You can use WMI if your hardware is compliant. Use the wbemtest.exe
utility to confirm whether or not you can even retrieve the
temperature. There are two ways I know of to retrieve the temperature
information.

1) Using wbemtest.exe connect to the namespace "root\cimv2" (without
quotes). Click the Query button and enter "select * from
Win32_TemperatureProbe". Double click on any result you get back and
look for the CurrentReading property in the properties section. The
value you see there should be the temperature. If it just shows
"<null>" then this option will not work.

2) Using wbemtest.ext connect to the namespace "root\WMI". Enter the
query "select * from MSAcpi_ThermalZoneTemperature". Double click on
any result you get back and look for the CurrentTemperature property.
The value is in tenths of degrees Kelvin.

Using #2 I can see that I have 3 temperature probes in my laptop. I
can view their values in .NET using the following code. I apologize in
advance for using C# in VB forum.

// Reference the System.Management.dll assembly first.
using System.Management;

public class Temperature
{
public static void Main()
{
string scope = @"root\WMI";
string query = @"select * from MSAcpi_ThermalZoneTemperature";

ManagementObjectSearcher searcher = new
ManagementObjectSearcher(scope, query);

foreach (ManagementObject obj in searcher.Get())
{
Console.WriteLine(obj.Properties["CurrentTemperature"].Value);
}
}
}

Brian

anthony wrote:
One the computer I am programmig I could see the CPU temperature in
the BIOS, is there a system DLL in VB.NET that I can call to
display the temperature in my software?

Thanks!


Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Derek Ross | last post by:
Hello, Say I have a server that's saving the CPU temperature to 'temperature.js' once a second. The contents of the file is one single line: var temperature = "35.5"; And it changes as...
1
by: Tom | last post by:
Hi guys, I'm trying to read the cpu temperature.. and I've been playing with WMI for a few days could not get it to work :( if I continue anymore I think I'll be bald very soon :P so any crumbs...
1
by: deanfamily11 | last post by:
I'm trying to have this program do a simple temperature conversion from Fahrenheit to Celsius. I have confirmed that the other variable is receiving and calculating the conversion, but it is just...
1
by: pollardw | last post by:
i have written a small program to convert Fahrenheit to Celsius and I have a minor problem. Here is the code what do i need to change to get it to work? /* Convert Fahrenheit to Celsius */ ...
4
by: arnuld | last post by:
this is my final code. Can you folks advise some improvements for making this programme better? BTW, i aways compile my programme with this cmmand on Linux: g++ -ansi -pedantic -Wall -Wextra...
21
by: AsheeG87 | last post by:
Hey Everyone~ I'm still a C++ Rookie so please bear with me on this. I'm doing a temperature conversion program with prototype functions. Basicly, I was wondering if some of you would take a look...
16
by: Brigitte Behrmann | last post by:
I am absolutely stuck with this one. I have to create a temperature conversion calculator that rounds the resulting temperature to the nearest whole number & vice versa. The result must be displayed...
25
by: kid joe | last post by:
Hi, Is it normal for the temperature of your CPU to increase as time goes on? I've got an Athlon XP 2100+ and I see that the temp is now at 51C where it used to be around 42 to 44. Anyone...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.