procedure downloaddir(directorylistbox1:tdirectorylistbox;nmftp1:tnmftp;Filelistbox4,Filelistbox2:tFilelistbox;dirname:string);
var T,S:array [1..100] of string;
Q,P,temp:string;
top,i:integer;
begin
top:=1;
T[1]:=DirectoryListBox1.Directory+'/'+dirname;
S[1]:=NMFTP1.CurrentDir+'/'+dirname;
mkdir(DirectoryListBox1.Directory+'/'+dirname);
while top<>0 do
begin
p:=s[top]; //远地
q:=t[top]; //本地
NMFTP1.ChangeDir(p);
//mkdir(q);
chdir(q);
temp:=q;
top:=top-1;
if FileLIstBox4.Items.Count<>0 then
for i:=0 to FileListBox4.Items.Count-1 do
nmftp1.download(p+'/'+Filelistbox4.items.strings ,q+'/'+Filelistbox4.items.strings);
if FileLIstBox2.Items.Count>1 then
for i:=1 to FileListBox2.Items.Count-1 do
begin
top:=top+1;
s[top]:=NMFTP1.CurrentDir+'/'+FileListBox2.Items.Strings;
mkdir(FileListBox2.Items.Strings);
t[top]:=temp+'/'+FileListBox2.Items.Strings;
end;
end;
showmessage('目录下载完毕!');