Tema: Descarga FTP
Ver Mensaje Individual
  #22  
Antiguo 18-01-2006
Avatar de Bicho
[Bicho] Bicho is offline
Miembro Premium
 
Registrado: jul 2003
Ubicación: Inca - Mallorca
Posts: 1.776
Reputación: 22
Bicho Va por buen camino
En principio es correcto,

realizas un create del objeto StringList antes de asignar al FTP.List
Código Delphi [-]
function FTP;
Var StringList : tStringList;
    r : Integer;
begin
     StringList := TSTringList.Create  //me lo dejé cuante te lo expliqué en el primer post
     IdFTP1.host := Host;
     IdFTP1.User := User;
     IdFTP1.Password := Password;
     try
        IdFTP1.connect;
        IdFTP1.changedir(dir);
     except
     end;

     IdFTP1.List(StringList, '*.txt', False);
     for r := 0 to StringList.count-1 do begin
          lista.Items.add(StringList[r]);
     end;
      IdFTP1.disconnect;
      StringList.Free;
end;

Antes me referia a que copiaras el texto del mensaje de error que te da cuando ejecutas el programa.
Responder Con Cita