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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kimiraikkonen

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

    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 ManagementObjec tSearcher( _
    "root\WMI", _
    "SELECT * FROM MSAcpi_ThermalZ oneTemperature" )

    For Each queryObj As ManagementObjec t In searcher.Get()
    MsgBox(queryObj ("CurrentTemper ature"))
    Next

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

    Thanks!


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

    Onur Güzel
Working...