是否可以嵌套地使用LIST方法?如下代码:
var
n,m: integer;
iDirCount1, iDirCount2: integer;
ss1,ss2,att1,att2: string;
remote_dir,local_dir: string;
begin
         nmftp1.ParseList:=true;
nmftp1.ChangeDir(remote_dir);
nmftp1.List;
iDirCount1:=nmftp1.FTPDirectoryList.name.count;
for n:=0 to iDirCount1-1 do
begin
ss1:=nmftp1.FTPDirectoryList.name.Strings[n];
att1:=nmftp1.FTPDirectoryList.Attribute.Strings[n];
if uppercase(copy(pchar(att1),1,1))<>'D' then continue; if not DirectoryExists(local_dir+ss1) then CreateDir(local_dir+ss1);

nmftp1.ChangeDir(ss1);
nmftp1.List;
iDirCount2:=nmftp1.FTPDirectoryList.name.count;
for m:=0 to iDirCount2-1 do
begin
ss2:=nmftp1.FTPDirectoryList.name.Strings[m];
att2:=nmftp1.FTPDirectoryList.Attribute.Strings[m];
if uppercase(copy(pchar(att2),1,1))='D' then continue;

if uppercase(ExtractFileExt(ss2))='.JPG' then
nmftp1.Download(ss2, local_dir+ss1+'\'+ss2);
end;
end;

end;
代码运行有问题,究竟哪里不对呢?求助!