Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

83 views
Skip to first unread message

kimiraikkonen

unread,
Apr 24, 2008, 6:37:50 AM4/24/08
to
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

0 new messages