火
火柴天堂
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure downloaddir(directorylistbox1:tdirectorylistbox;nmftp1:tnmftp;Fil
elistbox4,Filelistbox2:tFilelistbox;dirname:string);
var
hei,i:integer;
localdir:string;
remotedir:string;
begin
mkdir(dirname); //在本地创建相同的目录
localdir:=DirectoryListBox1.directory+'/'+dirname;
//读取本地的当前目录
directorylistbox1.directory:=localdir;
remotedir:=nmftp1.currentdir+'/'+dirname;
//读取远地的当前目录
nmftp1.changedir(remotedir); //远地进入下一层目录
if Filelistbox4.items.count>0 then //下载该目录下的文件
for hei:=0 to (Filelistbox4.items.count-1) do
nmftp1.download(remotedir+'/'+Filelistbox4.items.strings[hei],localdir+'/'+Filelistbox4.items.strings[hei]);
if Filelistbox2.items.count>1 then //mulu
for i:=1 to (Filelistbox2.items.count-1) do
begin
//showmessage(Filelistbox2.items.strings[hei]);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//总是在这儿越界,不知为什么.
try
downloaddir (directorylistbox1,nmftp1,Filelistbox4,
Filelistbox2,Filelistbox2.items.strings);
except
on E:exception do
continue;
end;
end;
end;
递归到最底层向上返回时,报错out of bound(*)
请各位大虾指教
若有可能请给出正确的方法(具体程序),告急!!!
elistbox4,Filelistbox2:tFilelistbox;dirname:string);
var
hei,i:integer;
localdir:string;
remotedir:string;
begin
mkdir(dirname); //在本地创建相同的目录
localdir:=DirectoryListBox1.directory+'/'+dirname;
//读取本地的当前目录
directorylistbox1.directory:=localdir;
remotedir:=nmftp1.currentdir+'/'+dirname;
//读取远地的当前目录
nmftp1.changedir(remotedir); //远地进入下一层目录
if Filelistbox4.items.count>0 then //下载该目录下的文件
for hei:=0 to (Filelistbox4.items.count-1) do
nmftp1.download(remotedir+'/'+Filelistbox4.items.strings[hei],localdir+'/'+Filelistbox4.items.strings[hei]);
if Filelistbox2.items.count>1 then //mulu
for i:=1 to (Filelistbox2.items.count-1) do
begin
//showmessage(Filelistbox2.items.strings[hei]);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//总是在这儿越界,不知为什么.
try
downloaddir (directorylistbox1,nmftp1,Filelistbox4,
Filelistbox2,Filelistbox2.items.strings);
except
on E:exception do
continue;
end;
end;
end;
递归到最底层向上返回时,报错out of bound(*)
请各位大虾指教
若有可能请给出正确的方法(具体程序),告急!!!