habe da etwas im Netz gefunden was Dir helfen könnte.
Delphi-Quellcode:
procedure TMain.btnArpClick(Sender: TObject);
var
DestIP, SrcIP: IPAddr;
pMacAddr: PULong;
AddrLen: ULong;
MacAddr: array[0..5] of byte;
p: PByte;
s: string;
i: integer;
begin
SrcIp := 0;
s := '';
InputQuery('Find Mac Address by Arp Request','Input Destination IPAddress',s);
DestIP := inet_addr(PChar(s));
pMacAddr := @MacAddr[0];
AddrLen := SizeOf(MacAddr);
SendARP(DestIP, SrcIP, pMacAddr, AddrLen);
s := ' MacAddress : ';
p := PByte(pMacAddr);
if Assigned(p) and (AddrLen>0) then
for i := 0 to AddrLen-1 do
begin
s := s + IntToHex(p^,2) + '-';
Inc(p);
end;
SetLength(s, length(s)-1);
sbMain.Panels[2].Text:=s;
end;
wobei SendArp eine Funktion aus iphlpapi.dll ist:
function SendARP; external 'iphlpapi.dll' name 'SendARP';
Die
dll habe ich angefügt.
Grüße
Klaus