谢谢兄弟你说的方法可以,但是我把Indy升级到10.0后出现下面的问题:
TFTPTransfer = class(TTransfer)
private
FIdfTP: TIdfTP;
procedure SetHost(const Value: string); override;
protected
function GetOnStatus: TIdStatusEvent; override;
procedure SetOnStatus(Value: TIdStatusEvent); override;
public
constructor Create;
destructor Destroy; override;
procedure Connect; override;
procedure Get(FileName: String); overload; override;
procedure Get(Stream: TStream); overload; override;
procedure WorkStart(Sender: TObject; AWorkMode: TWorkMode; const
AWorkCountMax: Integer); override;
end;
constructor TFTPTransfer.Create;
begin
inherited Create;
FIdFTP := TIdFTP.Create(nil);
FIdFtp.OnWorkBegin := Self.WorkStart; //这里时提示错误:
self.Port := 21;
end;