核心提示:连接FTP服务器IdFTP.Username := 'UserName';IdFTP.Password := 'Passw';IdFTP.Host := 'danielworld.netfirms.c...
连接FTP服务器IdFTP.Username := 'UserName';
IdFTP.Password := 'Passw';
IdFTP.Host := 'danielworld.netfirms.com';
IdFTP.Connect;
列出文件
procedure TIdFTP.List(ADest: TIdStrings; const ASpecifier: string = ''; ADetails: Boolean = True);
变更目录
procedure TIdFTP.ChangeDir(const ADirName: string);
上传文件
procedure TIdFTP.PutPut(const ASource: TIdStream; const ADestfile: string; const AAppend: Boolean = False);
下载文件
procedure TIdFTP.Get(const ASourceFile, ADestfile: string; const ACanOverwrite: Boolean = False;
AResume: Boolean = False);
我想获取上传下载的进度应该怎么做?
三个回调事件进行赋值:IdFTP.OnWork,IdFTP.OnWorkBegin,IdFTP.OnWorkEnd
其定义如下,参数意义很明显
TWorkBeginEvent = procedure(ASender: TObject; AWorkMode: TWorkMode; AWorkCountMax: Int64) of object;
TWorkEndEvent = procedure(ASender: TObject; AWorkMode: TWorkMode) of object;
TWorkEvent = procedure(ASender: TObject; AWorkMode: TWorkMode; AWorkCount: Int64) of object;