A AI_Player Unregistered / Unconfirmed GUEST, unregistred user! 2002-07-05 #1 曾看过C的代码,但由于本人C学得太Y,谁能给个delphi的代码,谢了!
张 张无忌 Unregistered / Unconfirmed GUEST, unregistred user! 2002-08-22 #3 用DELPHI来计算IP CHECKSUM function checksum(bufferword;size:integer):word; //校验和函数 var cksum:Longword; bufword; begin cksum:=0; buf:=buffer; while size>1 do begin cksum:=cksum+buf^; inc(buf); dec(size,sizeof(word)); end; if size=1 then inc(cksum,Pbyte(buf)^); cksum:=(cksum shr 16)+(cksum and $FFFF); cksum:=(cksum shr 16)+cksum; result:=word(not cksum); end;
用DELPHI来计算IP CHECKSUM function checksum(bufferword;size:integer):word; //校验和函数 var cksum:Longword; bufword; begin cksum:=0; buf:=buffer; while size>1 do begin cksum:=cksum+buf^; inc(buf); dec(size,sizeof(word)); end; if size=1 then inc(cksum,Pbyte(buf)^); cksum:=(cksum shr 16)+(cksum and $FFFF); cksum:=(cksum shr 16)+cksum; result:=word(not cksum); end;
A AI_Player Unregistered / Unconfirmed GUEST, unregistred user! 2002-08-22 #4 那定义IP头呢? 还有setsockopt的参数怎么填?
张 张无忌 Unregistered / Unconfirmed GUEST, unregistred user! 2002-08-23 #5 这个都不难,找个C的程序修改就OK了,我用过DELPHI做过ICMP ,UDP,TCP的,都没有 问题,说明只要是C能做的,DELPHI都能做,
A AI_Player Unregistered / Unconfirmed GUEST, unregistred user! 2002-08-23 #6 关键是对C不了解,不清楚C的数据类型在delphi里应该换成什么