大家看一下,我用WINDOWS FTP服务没有问题,而用Serv-U时,在LIST时,总报一个导常.将FTP设置成APassive也不行啊,高手帮忙.
function TCompareFinance.GetDirList: Boolean;
var i:integer;
tempList:TStringS;
begin
result := true;
tempList:=TStringList.Create;
try
try
DirList.Clear;
GetFTPInfo; //得到FTP信息,如IP,PORT,USER等
if not ftp.Connected then
ftp.Connect(true, 5000);
ftp.Passive := true;
ftp.List(tempList,'*.*',false);
for i:=0 to tempList.Count-1 do
try
ftp.ChangeDir(tempList.Strings[i]);
ftp.ChangeDirUp;
DirList.Add(tempList.Strings[i]);
except
end;
except
result:=false;
end;
finally
tempList.Free;
ftp.Disconnect;
end;
end;
function TCompareFinance.GetDirList: Boolean;
var i:integer;
tempList:TStringS;
begin
result := true;
tempList:=TStringList.Create;
try
try
DirList.Clear;
GetFTPInfo; //得到FTP信息,如IP,PORT,USER等
if not ftp.Connected then
ftp.Connect(true, 5000);
ftp.Passive := true;
ftp.List(tempList,'*.*',false);
for i:=0 to tempList.Count-1 do
try
ftp.ChangeDir(tempList.Strings[i]);
ftp.ChangeDirUp;
DirList.Add(tempList.Strings[i]);
except
end;
except
result:=false;
end;
finally
tempList.Free;
ftp.Disconnect;
end;
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货