VB6 IP地址+网卡地址+网卡类型
Sub Form_Load() Dim strComputer As String Dim objWMI As Object Dim colIP As Object Dim IP As Object Dim I As Integer strComputer = "." Set objWMI = GetObject("winmgmts://" & strComputer & "/root/cimv2") Set colIP = objWMI.ExecQuery _ ("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
For Each IP In colIP If Not IsNull(IP.IPAddress) Then For I = LBound(IP.IPAddress) To UBound(IP.IPAddress) MsgBox "IP 地址" & IP.IPAddress(I) & Chr(10) & _ "网卡类型" & IP.Description(I) & Chr(10) & _ "网卡地址" & IP.Macaddress(I) Next End If Next End Sub