Помогите дописать правильно Delphi

Discussion in 'С/С++, C#, Rust, Swift, Go, Java, Perl, Ruby' started by triblekill, 8 Oct 2016.

  1. triblekill

    triblekill Member

    Joined:
    21 Aug 2011
    Messages:
    351
    Likes Received:
    94
    Reputations:
    1
    Code:
    procedure th.Execute;
    var
    result,result2:boolean;
    begin
      while work do begin
        CS.Enter;
        Inc(Proxy);
        if Proxy<Proxys.Count then CurProxy:=Proxy else Work:=False;
        Cs.Leave;
        if work then begin
          http:=thttpsend.Create;
    
            ip:=Copy(Proxys[CurProxy],1,Pos(':', Proxys[CurProxy])-1);
            port:=Copy(Proxys[CurProxy], Pos(':', Proxys[CurProxy])+1, Length(Proxys[CurProxy]));
            http.ProxyHost:=ip;
            http.ProxyPort:=port;
            //form1.Memo2.lines.Add('Обращение к HTTP');
          //http.Timeout:=strtoint(Form1.Edit3.text);
          http.Protocol:='1.1';
          result:=http.HTTPMethod('GET', Form1.Edit1.text);
          if result then
            rez:=1;
          if not result then begin
        http.Sock.SocksIP:=ip;
        http.Sock.SocksPort:=port;
        //form1.Memo2.lines.Add('Обращение к SOCKS');
        result2:=http.HTTPMethod('GET', Form1.Edit1.text);
        if result2 then
        rez:=2;
        if not result2 then
        rez:=-1;
        end;
        //form1.Memo2.lines.Add('Обращение к ERROR');
         http.Free;
          Synchronize(Sync);
        end
      end
    end;