如何下载服务器上的一个文件夹里的所有文件?谢谢!!最好给个程序。
解决方案 »
- Delphi下把数据保存成word,使用Servers组件
- 怎样才能使CoolBar只显示一行
- 三层结构中dCom的连接
- 如果把"网站名"和"网址"添加ie收藏夹里去了?例子如下
- 初学者问题
- The element 'xs:schema' is used but not declared in the DTD/Schema
- ●●●●如何使panel1和panel2固定为改变其中一个左右移动时另一个右左同步移动上下也一样。
- Nativexml for 2010 GB2312错误
- 关于internet编程的小问题(给大分)!
- 又见csdn!
- 问一个关于用ADO连接SQL SEVRE 2000的问题
- 在fastport中要进行添加、保存,按钮要放到哪里
我有段代码,不过有下面的问题,你看看能否调通(错误:nmftp1.FTPDirectoryList.name.Count恒为0),我这方面懂的不多,兄弟多帮助。
我另外开个帖子,100分激情相赠解决者(有新的方法也行,最好给个例子)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
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);
ex_download(remote_dir+ss+'\',local_dir);
end;
end;
result:=true;
end
except
On E:Exception do begin
result:=false;
end;
end;
end;
可以用winexec调用其他控制台命令,有时候很省事的