Ver Mensaje Individual
  #17  
Antiguo 27-01-2009
tocomi tocomi is offline
Miembro
 
Registrado: may 2006
Posts: 45
Reputación: 0
tocomi Va por buen camino
Este es el codigo que estoy usando pero cuando llega el minuto de armar la lista de archivos se cae y no logro encontrar el problema

Estoy usando Delphi 2007 con las librerias Indy que trae, nombre de usuario y clave funcionan, no se me ocurre que otro dato agregar para que tengan mas informacion

Cualquier ayuda sera bienvenida, Saludos y Gracias por su tiempo

Código:
 
var
  Archivos:TStringList;
begin
  Archivos := TStringList.Create;
  Archivos.Clear;
  IdFTP.Username := 'usuario';
  IdFTP.Password := 'contraseña';
  IdFTP.Host := 'ftp.servidor.com';
  IdFTP.Connect; // Conectamos...
  if idftp.Connected then
     begin
     try
        Idftp.SendCmd('CWD /var/www/html/programas/');
        Edit1.text:=Idftp.RetrieveCurrentDir;
        IdFTP.List(Archivos,'',false); //probe tambien con IdFTP.List(Archivos,'*.*',false); y con  IdFTP.List(Archivos,'*.*',true);  
        if (IdFTP.DirectoryListing <> nil) then
           ShowMessage(DateTimeToStr(IdFTP.DirectoryListing.Items[0].ModifiedDate))
        else
           raise Exception.Create('Asegúrate que el archivo exista en el Servidor');
     except
        Archivos.Free;
        showmessage('no se pudo cambiar la carpeta');
     end;
  end;
  IdFTP.Disconnect;
  Archivos.free;

Última edición por tocomi fecha: 27-01-2009 a las 21:08:40.
Responder Con Cita