2012年5月12日 星期六

Win32_NetworkAdapterConfiguration


SELECT * FROM  Win32_NetworkAdapterConfiguration



 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
     Dim mc As System.Management.ManagementClass
     Dim mo As ManagementObject
     mc = New ManagementClass("Win32_NetworkAdapterConfiguration")
     Dim moc As ManagementObjectCollection = mc.GetInstances()
     For Each mo In moc
     If mo.Item("IPEnabled") = True Then
     ListBox1.Items.Add("MAC address " & mo.Item("MacAddress").ToString())
     ListBox1.Items.Add("MAC address " & mo.Item("IPEnabled").ToString())
     End If
     Next
    End Sub

沒有留言:

張貼留言