我在使用TidFTP组件时遇到了问题.
我可以使用这样的代码连接服务器
vFileList := TStringList.Create;
oClientFTP := TidFTP.Create(nil);
oClientFTP.Port := PortFTP;
oClientFTP.Host := IPHost;
oClientFTP.UserName := UserFTP;
oClientFTP.Password := PasswordFTP;
Run Code Online (Sandbox Code Playgroud)
从元素序列中获取多个文件后(这个元素正好有778个元素).检索到137,异常EIdAcceptTimeout以"Accept timed out"引发.信息.
我运行的代码是这样的(顺便说一下在线程中运行)
procedure TDownloadFTP.Get;
begin
try
for I := 0 to vFileList .Count - 1 do
begin
sFileName:= vFileList [I];
posPoint := LastDelimiter('.', sFileName);
if posPoint = 0 then
ForceDirectories(ExtractFilePath(Application.ExeName) + '/BackUp/' + sFileName)
else
try
oClienteFTP.Get(sFileName,IncludeTrailingPathDelimiter(ExtractFilePath(Application.ExeName) + '/BackUp/') + sFileName, True);
except
on E: EIdReplyRFCError do
begin
end;
on E: Exception do
exceptionList.Add(sFileName);
end;
end;
Run Code Online (Sandbox Code Playgroud)
异常后,文件正确下载,但每个文件的过程需要25秒(我正在下载2KB的png图像).
知道这个例外的含义吗? …