N
netbug
Unregistered / Unconfirmed
GUEST, unregistred user!
请看:<br>uses winsock;<br>procedure TForm1.Button1Click(Sender: TObject);<br>var err,j,k:integer;<br>wd:wsadata;<br>sk:tsocket;<br>ar,ar1:sockaddr_in;<br>buf:array [0..1000] of char;<br>begin<br> err:=wsastartup(2,wd);<br> sk:=socket(PF_INET,SOCK_RAW,IPPROTO_ICMP);<br> if sk<>INVALID_SOCKET then begin<br> ar.sin_family:=AF_INET;<br> ar.sin_addr.S_un_b.s_b1:=chr(192);<br> ar.sin_addr.S_un_b.s_b2:=chr(1);<br> ar.sin_addr.S_un_b.s_b3:=chr(1);<br> ar.sin_addr.S_un_b.s_b4:=chr(5);<br> ar.sin_port:=6123; end;<br> j:=bind(sk,ar,sizeof(ar));<br> k:=recvfrom(sk,buf,1000,0,ar1,sizeof(ar1));<br>end;<br>其中192.1.1.5是本地机子的IP,我在编译时,系统老是在<br>k:=recvfrom(sk,buf,1000,0,ar1,sizeof(ar1))提示:<br>[Error]:Types of actual and formal var parameters must be identical<br>我不知我的实参与形参在哪不一致,请各位大虾赐教,谢谢。