IDFtp list问题,请大家帮忙 Delphi / Windows SDK/APIhttp://www.delphi2007.net/DelphiNetwork/html/delphi_20061128084519243.html
大家看一下,我用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;
我用Serv-U,好像List(*.*)没问题。