谢谢大家的建议,但我已经用NMFTP做了一半,时间已不允许我改换其它控件了。
我在下载服务器文件到本地c:/时,出现了错误,请大家帮帮忙。 procedure TMainFTP.download;
const
driver='c:';
var
T,S:array[0..500] of string;
temp1,temp2:string;
count,flag,i:integer;
begin
T[0]:=driver+'/';//本地
S[0]:='/'; //远地
count:=0;
for i:=1 to NMFTP1.FTPDirectoryList.name.Count do
with NMFTP1.FTPDirectoryList do
begin
if Attribute[1] <>'d'
then NMFTP1.Download(S[0]+Name,T[0]+Name)
else
begin
count:=count+1;
S[count]:=S[0]+Name;
T[count]:=T[0]+Name;
end;
end;
flag:=1;
while flag<=count do
begin
NMFTP1.ChangeDir(S[flag]);
try
temp1:=T[flag];
temp2:=S[flag];
chdir(temp1);
except
mkdir(temp1);
end;
for i:=1 to NMFTP1.FTPDirectoryList.name.Count do
with NMFTP1.FTPDirectoryList do
begin
if Attribute[1] <>'d'
then NMFTP1.Download(temp2+Name,temp1+Name)
else
begin
count:=count+1;
S[count]:=temp2+Name;
T[count]:=temp1+Name;
end;
end;
end;
end;
错误为:project FTP.exe raised exception class EStringlistError with message 'list index out of bounds(8)',...