为什么下面代码所运行得到的ErrCode都是87啊!求各位高手帮忙.Function TForm1.sendarp(ipaddr:ulong;
temp:dword;ulmacaddr:pointer;
ulmacaddrleng:pointer) : DWord;
StdCall; External 'Iphlpapi.dll' Name 'SendARP';procedure TForm1.Button1Click(Sender: TObject);
var
myip:ulong;
mymac:array[0..5] of byte;
mymaclength:ulong;
ErrCode:integer;
begin
myip:=inet_addr(PChar(edit1.text));
ShowMessage(IntToHex(myip,8));
mymaclength:=6;
ErrCode:=sendarp(myip,0,@mymac,@mymaclength);
ShowMessage( 'dwResult: '+IntToStr(ErrCode));
label1.caption:='errorcode:'+inttostr(ErrCode);
label2.caption:=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]]);
end;
temp:dword;ulmacaddr:pointer;
ulmacaddrleng:pointer) : DWord;
StdCall; External 'Iphlpapi.dll' Name 'SendARP';procedure TForm1.Button1Click(Sender: TObject);
var
myip:ulong;
mymac:array[0..5] of byte;
mymaclength:ulong;
ErrCode:integer;
begin
myip:=inet_addr(PChar(edit1.text));
ShowMessage(IntToHex(myip,8));
mymaclength:=6;
ErrCode:=sendarp(myip,0,@mymac,@mymaclength);
ShowMessage( 'dwResult: '+IntToStr(ErrCode));
label1.caption:='errorcode:'+inttostr(ErrCode);
label2.caption:=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]]);
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货