|
|
导航: |
论坛 -> 网络通讯
斑竹:liumazi,sephil |
|
作者: |
|
2004/2/25 17:44:25 |
标题: |
如何用D6的NMFTP控件编写一个下载整个目录的程序 |
浏览:2416 |
|
加入我的收藏 |
楼主: |
各位大哥: 如何用D6的NMFTP控件编写一个下载整个目录的程序? 我下载过一个说是能够下载整个目录的程序,结果不能下载,你们帮我看看:
file ://目录下载
function tftp.ex_download(remote_dir,local_dir:string):boolean;
var
i,j,count1:integer;
att,ss:string;
current_dir:string;
temp_dir:string;
begin
try begin
NMFTP1.ChangeDir(remote_dir);
current_dir:=remote_dir;
temp_dir:=copy(current_dir,2,length(current_dir));
if not DirectoryExists(local_dir) then CreateDir(local_dir);
if not directoryexists(local_dir+temp_dir) then createdir(local_dir+temp_dir);
nmftp1.ParseList:=true;
NMftp1.list;
count1:=nmftp1.FTPDirectoryList.name.Count;
for i:=0 to count1-1 do begin
file ://必须
NMFTP1.ChangeDir(current_dir);
nmftp1.list;
ss:=nmftp1.FTPDirectoryList.name.Strings[i];
att:=nmftp1.FTPDirectoryList.Attribute.Strings[i];
if (copy(pchar(att),1,1)<>'d')and(copy(pchar(att),1,1)<>'D') then begin
if not DirectoryExists(local_dir) then CreateDir(local_dir);
NMFTP1.Download(current_dir+ss,local_dir+temp_dir+ss);
end
else begin
if not directoryexists(local_dir+temp_dir+ss) then createdir(local_dir+temp_dir+ss);
file ://递归调用
ex_download(remote_dir+ss+'\',local_dir);
end;
end;
result:=true;
end
except
On E:Exception do begin
result:=false;
end;
end;
end;
如果行的话,回复一下,或者E-mail给我:myneptune@163.com
----------------------------------------------
......::::::: 我们做的就是最好的 ::::::::::....... |
作者: |
|
2004/2/26 13:37:55 |
1楼: |
我成功了,呵呵!
----------------------------------------------
......::::::: 我们做的就是最好的 ::::::::::.......
|
|