I need some help with WMI in dotnet

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

    I need some help with WMI in dotnet

    Hello Group,

    I've put together this code below which gets information from the local
    computer and prints it in a text box. I would like to be able to do the same
    to other computers on my network but I'm not sure how to point WMI to
    another computer. Here is the code I have so far,

    Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
    System.EventArg s) Handles Button1.Click

    Dim search As New ManagementObjec tSearcher("SELE CT * FROM Win32_BIOS")

    Dim search2 As New ManagementObjec tSearcher("SELE CT * FROM
    Win32_ComputerS ystem")

    Dim search3 As New ManagementObjec tSearcher("SELE CT * FROM Win32_Processor ")

    Dim info As ManagementObjec t

    For Each info In search.Get()

    TextBox1.Text = "Serial Number: " & info("serialnum ber").ToString( ) & CRLF

    TextBox1.Text += "Manufactur er: " & info("Manufactu rer").ToString( ) & CRLF

    Next

    For Each info In search2.Get()

    TextBox1.Text() += "Model: " & info("Model").T oString() & CRLF

    TextBox1.Text() += "Computer Name: " & info("Name").To String() & CRLF

    TextBox1.Text() += "User Name Logged in: " & info("UserName" ).ToString() &
    CRLF & CRLF

    TextBox1.Text() += "Total Physical Memory: " &
    info("TotalPhys icalMemory").To String() & (" KB of Ram") & CRLF

    Next

    For Each info In search3.Get()

    TextBox1.Text() += "CPU Clock Speed: " & info("Name").To String() & CRLF

    Next

    End Sub

    Thanks for any help or web links you can provide on this matter,

    Jim Scheffler


Working...