function sendarp(ipaddr:ulong;temp:dword;ulmacaddr:pointer;ulmacaddrleng:pointer) : Dword; StdCall;
External 'Iphlpapi.dll' Name 'SendARP';
function GetMACByIP(const Ip:string):string;
var
MyIp:ulong;
MyMac:array[0..5] of byte;
MyMacLength:ulong;
ErrCode:integer;
begin
Myip:=inet_addr(PChar(Ip));
MyMacLength:=Length(MyMac);
ErrCode:=SendArp(MyIp,0,@MyMac,@MyMacLength);
if ErrCode = 0 then
Result := Format('%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x',[MyMac[0],MyMac[1],MyMac[2],MyMac[3],MyMac[4],MyMac[5]])
else
Result := ''; //EorrCode: ErrCode
end;