Ver Mensaje Individual
  #5  
Antiguo 05-09-2011
Avatar de dec
dec dec is offline
Moderador
 
Registrado: dic 2004
Ubicación: Alcobendas, Madrid, España
Posts: 13.107
Reputación: 34
dec Tiene un aura espectaculardec Tiene un aura espectacular
Hola,

Y saca el "Create" fuera del "Try":

Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
procedure TForm1.Button1Click(Sender: TObject);
const
    paginas:array[1..4] of string = ('index.php','noexisto.php','basura/noexisto','index.php');

var
    IdHTTP: TIdHTTP;
    i:integer;
begin
    IdHTTP := TIdHTTP.Create(nil);
    try
        
        for i:= Low(paginas) to High(paginas) do
        try
            IdHTTP.Get(Edit1.Text+'/'+paginas[i]);

            if  IdHTTP.ResponseCode=200 then
                Memo1.Lines.Add(Edit1.Text+'/'+paginas[i]);
        except
            on E : EIdHttpProtocolException do {nothing!};
            on E : Exception do {nothing!};
        end;
    finally
        idHTTP.Free;
    end;
end;

¡Esto sí que es un mete-saca!
Responder Con Cita