lunedì 9 dicembre 2013

[VB6] conoscere MAC address


Private Sub Command1_Click()
'elenco indirizzi IP

Dim objWMIService, colNetAdapters, objNetAdapter
    
  Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
  Set colNetAdapters = objWMIService.ExecQuery("Select * from Win32_NetworkAdapterConfiguration " & "where IPEnabled=TRUE")

  For Each objNetAdapter In colNetAdapters
    Text1(0).Text = objNetAdapter.Caption
    Text1(1).Text = objNetAdapter.MACAddress
    Text1(2).Text = Join(objNetAdapter.ipAddress, ",")
    MsgBox objNetAdapter.MACAddress

  Next


End Sub

Nessun commento:

Posta un commento