vb Code:
Private Declare Function SendARP Lib "iphlpapi.dll" (ByVal DestIP As Integer, ByVal SrcIP As Integer, ByRef pMacAddr As Long, ByRef PhyAddrLen As Integer) As Integer
Public Overrides Function Execute(ByVal ipAddress As IPAddress) As ColumnValue
Dim ResultatOUI As String = Nothing
Try
Dim ip As Integer = CInt(Net.IPAddress.Parse(ipAddress.ToString).Address)
Dim mem As Long
Dim ret As Integer = SendARP(ip, 0, mem, 6)
Dim ab() As Byte = BitConverter.GetBytes(mem)
Dim OUI As String = BitConverter.ToString(ab, 0, 3) '<-- forandre 3 til 6 for å få hele mac-adressen
'PS: OUI = mac address...
Using sr As IO.StreamReader = New IO.StreamReader(Application.StartupPath & "\ieee_oui.txt")
Dim line As String
Do
line = sr.ReadLine()
If line.Contains(OUI) Then
ResultatOUI = line.Remove(0, 18)
End If
Loop Until line Is Nothing
sr.Close()
End Using
Catch ex As Exception
'do nothing
End Try
Return New ColumnValue(ColumnIndex, ResultatOUI)
End Function