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

如果有人运行不出来的话==>首先,引用System.Management;然后在代码中Imports System.Management;
posted on 2005-01-17 00:56  dahai.net  阅读(889)  评论(0编辑  收藏  举报