国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

用clientsocket發送http頭請求

2019-11-18 17:59:56
字體:
來源:轉載
供稿:網友

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: ;
    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頭還真是難搞呀。


上一篇:一個多線程后臺掃描的程序和源代碼

下一篇:關于用IDhttp發送網站http頭的問題

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
學習交流
熱門圖片

新聞熱點

疑難解答

圖片精選

網友關注

主站蜘蛛池模板: 华宁县| 北票市| 深泽县| 丰宁| 灵武市| 泽库县| 穆棱市| 双辽市| 司法| 杭州市| 德保县| 互助| 玉田县| 留坝县| 霍城县| 高清| 黎平县| 中方县| 五华县| 江山市| 阿鲁科尔沁旗| 昭平县| 呼图壁县| 宜宾县| 永年县| 苏尼特左旗| 万全县| 万年县| 绵竹市| 仁怀市| 巴楚县| 横峰县| 舒城县| 天祝| 鹿邑县| 呼玛县| 桦川县| 铜山县| 五指山市| 静海县| 都兰县|