procedure tform1.button2click(sender: tobject);
var httpstr:string;
begin
cs1.active :=true;
httpstr:='get http://www.paymesurf.com:80/surf3.php?usrid=607 http/1.1'+#13#10;
httpstr:=httpstr+'accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*'+#13#10;
httpstr:=httpstr+'accept-language: zh-cn'+#13#10;
httpstr:=httpstr+'user-agent: mozilla/4.0 (compatible; msie 6.0; windows nt 5.0; myie2; .net clr 1.1.4322)'+#13#10;
httpstr:=httpstr+'host: www.paymesurf.com'+#13#10;
httpstr:=httpstr+'proxy-connection: keep-alive'+#13#10;
httpstr:=httpstr+' ';
memo1.lines.add(httpstr);
cs1.socket.sendtext(httpstr);
end;
procedure tform1.cs1read(sender: tobject; socket: tcustomwinsocket);
var s:string;
succ:boolean;
begin
succ :=false;
s:=socket.receivetext;
memo1.lines.add(s);
if (pos('200',s)<>0) then //返回信息:200 ok,表示发送成功
begin
statusbar1.simpletext:='成功!';
cs1.active :=false;
succ :=true;
end else
begin
statusbar1.simpletext:='失败';
cs1.active:=true;
succ :=false;
end;
end;
为什么没有反回数据呢。试了多次也不行。看来http头还真是难搞呀。