Advertisement
Guest User

ATTTerm.EngineFtp;

a guest
Jan 20th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.60 KB | None | 0 0
  1. unit ATTTerm.EngineFtp;
  2.  
  3. interface
  4.  
  5. uses Classes, IdFTP,SysUtils,idftpcommon;
  6.  
  7.  type TAtttermEngineFtp = class( TThread )
  8.     private
  9.     {Private declaration}
  10.     Ftp : TidFTP;
  11.     FPassword: string;
  12.     FHost: string;
  13.     FUserName: string;
  14.     FCaminhoDiretorioFtp: string;
  15.     protected
  16.     {Protected declaration}
  17.     public
  18.     procedure AfterConstruction; override;
  19.     procedure BeforeDestruction; override;
  20.     {Public declaration declaration}
  21.     property Host: string     read FHost     write FHost;
  22.     property UserName: string read FUserName write FUserName;
  23.     property password: string read FPassword write FPassword;
  24.     function EfetuaConexaocomservidor( aIdFtp: TIDFtP ): Boolean;
  25.     constructor Create( const DiretorioFtp: string ); reintroduce; Overload; (*Metodos do Constructor*)
  26.     destructor Destroy; override;
  27.  
  28.     published
  29.     {Protected declaration}
  30.     end;
  31.  
  32. implementation
  33.  
  34. { TAtttermEngineFtp }
  35.  
  36. procedure TAtttermEngineFtp.AfterConstruction;
  37. begin
  38.   inherited AfterConstruction;
  39.  
  40. end;
  41.  
  42. procedure TAtttermEngineFtp.BeforeDestruction;
  43. begin
  44.   inherited BeforeDestruction;
  45.  
  46. end;
  47.  
  48. constructor TAtttermEngineFtp.Create(const DiretorioFtp: string);
  49. begin
  50.   FCaminhoDiretorioFtp := DiretorioFtp;
  51. end;
  52.  
  53. destructor TAtttermEngineFtp.Destroy;
  54. begin
  55.  
  56.   inherited;
  57. end;
  58.  
  59. function TAtttermEngineFtp.EfetuaConexaocomservidor( aIdFtp: TIDFtP ): Boolean;
  60. begin
  61.   if Not Assigned( aIdFtp ) then
  62.   begin
  63.  
  64.     aIdFtp := TIdFTP.Create( nil );
  65.   end;
  66.  
  67.   aIdFtp.Host     := FHost;
  68.   aIdFtp.Password := FPassword;
  69.   aIdFtp.Username := FUserName;
  70. end;
  71.  
  72. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement