// 用SendARP获取MAC (我在win98使用该函数得不到MAC)
function SendARP( const DestIP : DWord; const SrcIP : DWord;
const pMacAddr : Pointer; const PhyAddrLen : PULONG) : DWord;
stdcall; external 'IPHLPAPI.DLL' name 'SendARP';
....
function GetRemoteMAC(ip:string):String;
var
dwResult : DWord;
ulIPAddr : DWord;
ulMACAddr : Array [0..5] of Byte;
ulAddrLen : ULONG;
begin
ulIPAddr := inet_addr(PChar(ip));
ulAddrLen := 6;
FillChar(ulMACAddr, 6, $ff);
dwResult := SendARP(ulIPAddr,0,@ulMACAddr,@ulAddrLen);
if dwResult=0 then
Result:=(IntToHex(ulMACAddr[0],2)+
IntToHex(ulMACAddr[1],2)+
IntToHex(ulMACAddr[2],2)+
IntToHex(ulMACAddr[3],2)+
IntToHex(ulMACAddr[4],2)+
IntToHex(ulMACAddr[5],2));
end;
inet_addr SendARP 未定义,我应该在USES中 引用什么啊?
小弟初学,,,,,,,
function SendARP( const DestIP : DWord; const SrcIP : DWord;
const pMacAddr : Pointer; const PhyAddrLen : PULONG) : DWord;
stdcall; external 'IPHLPAPI.DLL' name 'SendARP';
....
function GetRemoteMAC(ip:string):String;
var
dwResult : DWord;
ulIPAddr : DWord;
ulMACAddr : Array [0..5] of Byte;
ulAddrLen : ULONG;
begin
ulIPAddr := inet_addr(PChar(ip));
ulAddrLen := 6;
FillChar(ulMACAddr, 6, $ff);
dwResult := SendARP(ulIPAddr,0,@ulMACAddr,@ulAddrLen);
if dwResult=0 then
Result:=(IntToHex(ulMACAddr[0],2)+
IntToHex(ulMACAddr[1],2)+
IntToHex(ulMACAddr[2],2)+
IntToHex(ulMACAddr[3],2)+
IntToHex(ulMACAddr[4],2)+
IntToHex(ulMACAddr[5],2));
end;
inet_addr SendARP 未定义,我应该在USES中 引用什么啊?
小弟初学,,,,,,,
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货