Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Wmi As New System.Management.ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapterConfiguration")
TextBox1.Text = ""
For Each WmiObj As ManagementObject In Wmi.Get
If CBool(WmiObj("IPEnabled")) Then
TextBox1.Text += "IP(" & WmiObj("IPAddress")(0) & ")|MAC(" & WmiObj("MACAddress") & ")" & vbCrLf
End If
Next
End Sub本文地址:http://com.8s8s.com/it/it42998.htm