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;