Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Internet
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Colaboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #4  
Antiguo 04-09-2011
Avatar de Chris
[Chris] Chris is offline
Miembro Premium
 
Registrado: abr 2007
Ubicación: Jinotepe, Nicaragua
Posts: 1.678
Poder: 21
Chris Va por buen camino
Meté el try dentro del for:

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
    try
        IdHTTP := TIdHTTP.Create(nil);
        
        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;

He aplicado una pequeña reestructuración de tu código y he reparado una fuga de memoria que tenías en el. No estabas liberando el objeto idHTTP.

Saludos,
Chris
__________________
Perfil Github - @chrramirez - Delphi Blog - Blog Web
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
TidHttp con acentos keys Internet 3 29-07-2011 18:17:59
Ayuda urgente con Indy TIdHTTP Pugile C++ Builder 1 17-03-2011 12:21:04
TIDHTTP Con User y Pass Neeruu Varios 0 28-12-2009 13:36:49
Ayuda con incompatibilidad del Post de TIdHTTP de Indy 8 con Indy 10 rolandoj Internet 13 24-12-2008 13:19:01
TIdHTTP, dlls.... betto Internet 3 27-03-2007 21:49:03


La franja horaria es GMT +2. Ahora son las 23:44:04.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi