Hi,
When you look at the supported operating systems for
win32_temperatu reprobe I see windows xp. I do not see xp embedded.
http://msdn.microsoft.com/library/de...atureprobe.asp
Ken
------------------
"anthony" <an*******@cont rolengineer.com > wrote in message
news:OO******** ******@TK2MSFTN GP09.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(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button4.Click
Dim moReturn As Management.Mana gementObjectCol lection
Dim moSearch As Management.Mana gementObjectSea rcher
Dim mo As Management.Mana gementObject
Dim StrOutput As String
moSearch = New Management.Mana gementObjectSea rcher("root\cim v2", "Select *
from Win32_Temperatu reProbe")
moReturn = moSearch.Get
For Each mo In moReturn
StrOutput = StrOutput & " " & mo("Name") & " " & mo("CurrentRead ing")
Next
MsgBox(StrOutpu t)
End Sub
Private Sub Button5_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button5.Click
Dim moReturn As Management.Mana gementObjectCol lection
Dim moSearch As Management.Mana gementObjectSea rcher
Dim mo As Management.Mana gementObject
Dim StrOutput As String
moSearch = New Management.Mana gementObjectSea rcher("root\WMI ", "Select *
from MSAcpi_ThermalZ oneTemperature" )
moReturn = moSearch.Get
For Each mo In moReturn
StrOutput = StrOutput & " " &
Convert.ToStrin g(Convert.ToUIn t32(mo("Current Temperature")))
Next
MsgBox(StrOutpu t)
End Sub
"Brian Gideon" <br*********@ya hoo.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.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_Temperatu reProbe". 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_ThermalZ oneTemperature" . Double click on
any result you get back and look for the CurrentTemperat ure 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.Manageme nt.dll assembly first.
using System.Manageme nt;
public class Temperature
{
public static void Main()
{
string scope = @"root\WMI";
string query = @"select * from MSAcpi_ThermalZ oneTemperature" ;
ManagementObjec tSearcher searcher = new
ManagementObjec tSearcher(scope , query);
foreach (ManagementObje ct obj in searcher.Get())
{
Console.WriteLi ne(obj.Properti es["CurrentTempera ture"].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!