Ver Mensaje Individual
  #2  
Antiguo 18-12-2010
juank1971 juank1971 is offline
Miembro
 
Registrado: feb 2008
Posts: 230
Reputación: 17
juank1971 Va por buen camino
esta funcion esta programada con apuro pero te puede servir de algo
llena un arbol con el ftp, lo puedes adaptar a en lugar de llenar el arbol debes hacer un get recursivo, para subir al ftp es put y get para bajar

Código Delphi [-]
procedure TForm1.LlenaArbolDirectorioFTP(NodoA:TTreeNode;r:string);
var i,j:integer; Nodo,Nodo1:TTreeNode; n:string; t,t1:tstrings;
begin
  Nodo :=  TTreeNode.Create(nil); t:=tstringlist.Create ;
  t1:=tstringlist.Create ;
  with idftp1   do
    begin
     if connected then
      begin
        //raiz
          ExtListDir (t,r);
          ChangeDir(r);


       for I := 0 to DirectoryListing.Count - 1 do
        begin
         if DirectoryListing.Items[i].ItemType = ditDirectory then
          begin
            n:= DirectoryListing.Items[i].FileName;
            nodo := ArbolFTP.Items.AddChild(NodoA,n);
            nodo.ImageIndex := 0;nodo.SelectedIndex := 0;nodo.StateIndex := 2;
            //se mete y sale en las carpetas a ver si estan llenas o vacias
          end;//if DirectoryListing

         if DirectoryListing.Items[i].ItemType  = ditFile then
          begin
            nodo := ArbolFTP.Items.AddChild(NodoA,DirectoryListing.Items[i].FileName );
            nodo.ImageIndex := 3; nodo.SelectedIndex := 3;nodo.StateIndex := 2;
          end;//if DirectoryListing
        end;//for I :=
      end; // if connected
    end; // with datamodule2
    t.Free;
    t1.free;
end;
Responder Con Cita