"Not Supported" error on WMI Query in VB.NET

K

kimiraikkonen

Hello,
I wanted query my CPU's temperature using this WMI code, but it always
gives error "not suppored" as exception. I can monitor my Intel P4
Socket 478 CPU's temp with the softwares supplied by motherboard
manufacturer or other 3rd party softwares, but cannot using that WMI
code.

What's wrong? And how could i make sure that my system supports low-
level hardware WMI queries?

The function:

Public Overloads Shared Function readtemp() As Integer

Try
Dim searcher As New ManagementObjectSearcher( _
"root\WMI", _
"SELECT * FROM MSAcpi_ThermalZoneTemperature")

For Each queryObj As ManagementObject In searcher.Get()
MsgBox(queryObj("CurrentTemperature"))
Next

Catch err As ManagementException
MessageBox.Show("An error occurred while querying for WMI data: " &
err.Message)
End Try
End Function

Thanks!


Note: I referenced system.management DLL and using .NET 2.0 with XP
SP2 on VB2005 express.

Onur Güzel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top