读书人

(用SendARP获取MAC)    一个引用有

发布时间: 2012-02-29 16:44:10 作者: rapoo

(用SendARP获取MAC)    一个引用问题,未定义,
// 用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中 引用什么啊?
   小弟初学,,,,,,,




[解决办法]
uses

Winsock;

读书人网 >.NET

热点推荐