Z
zhousi
Unregistered / Unconfirmed
GUEST, unregistred user!
Stream := TWinSocketStream.Create(pclientf.ClientSocket1.Socket, 30000);
Buffer:=pchar(pclientf.Edit3.Text); //所要发送的字符串
head:='POST http://222.1.5.212:8080 HTTP/1.0'+#13+#10; //www.rtfm.be
head:=head+'Accept: */*'+#13+#10;
head:=head+'Content-Type: application/x-www-form-urlencoded'+#13+#10;
head:=head+'User-Agent: Mozilla/3.0(compatible)'+#13+#10;
head:=head+'Host: 222.1.5.212'+#13+#10;
head:=head+'Content-Length: ' + inttostr(length(Buffer))+#13+#10;
pclientf.ClientSocket1.Socket.SendText(head);
alllen:=length(Buffer) div 8192;
i:=0;
while (i<alllen+1) do
begin
if i=alllen then
Stream.WriteBuffer((buffer+i*8192)^,length(Buffer)-i*8192)
else
Stream.WriteBuffer((buffer+i*8192)^,8192);
i:=i+1;
end;
请高手帮忙看看,怎么修改上面程序!
Buffer:=pchar(pclientf.Edit3.Text); //所要发送的字符串
head:='POST http://222.1.5.212:8080 HTTP/1.0'+#13+#10; //www.rtfm.be
head:=head+'Accept: */*'+#13+#10;
head:=head+'Content-Type: application/x-www-form-urlencoded'+#13+#10;
head:=head+'User-Agent: Mozilla/3.0(compatible)'+#13+#10;
head:=head+'Host: 222.1.5.212'+#13+#10;
head:=head+'Content-Length: ' + inttostr(length(Buffer))+#13+#10;
pclientf.ClientSocket1.Socket.SendText(head);
alllen:=length(Buffer) div 8192;
i:=0;
while (i<alllen+1) do
begin
if i=alllen then
Stream.WriteBuffer((buffer+i*8192)^,length(Buffer)-i*8192)
else
Stream.WriteBuffer((buffer+i*8192)^,8192);
i:=i+1;
end;
请高手帮忙看看,怎么修改上面程序!