S
Stefan
hi,
i use this function to get the all mac adresses
how can i modify this function to get only the active connection.
Public Function GetMacAddress() As String
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 CBool(mo.Item("IPEnabled")) = True Then
MessageBox.Show("MAC address " & mo.Item("MacAddress").ToString())
End If
Next
End Function
i use this function to get the all mac adresses
how can i modify this function to get only the active connection.
Public Function GetMacAddress() As String
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 CBool(mo.Item("IPEnabled")) = True Then
MessageBox.Show("MAC address " & mo.Item("MacAddress").ToString())
End If
Next
End Function