怎么利用IdFTP控件获取FTP服务器端某个子文件目录中的文件列表
展开全部
----解决方案--------------------
FTPClient.List(list);
for i:=0 to list.Count-1 do
begin
Attribute:=FTPClient.DirectoryListing.Items[i].ItemType;
if Attribute=ditDirectory then
begin
showmessage('目录:'+FTPClient.DirectoryListing.Items[i].FileName);
end
else if Attribute=ditFile then
begin
showmessage('文件:'+FTPClient.DirectoryListing.Items[i].FileName);
end
else
begin
showmessage('其它:'+FTPClient.DirectoryListing.Items[i].FileName);
end;
end;
FTPClient.List(list);
for i:=0 to list.Count-1 do
begin
Attribute:=FTPClient.DirectoryListing.Items[i].ItemType;
if Attribute=ditDirectory then
begin
showmessage('目录:'+FTPClient.DirectoryListing.Items[i].FileName);
end
else if Attribute=ditFile then
begin
showmessage('文件:'+FTPClient.DirectoryListing.Items[i].FileName);
end
else
begin
showmessage('其它:'+FTPClient.DirectoryListing.Items[i].FileName);
end;
end;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询