idftp问题!

19750819 2006-01-06 12:35:44
IdFtp1.ChangeDir('/');
IdFtp1.List(nil);
为何IdFtp1.DirectoryListing.Count总为0,根目录小是有文件的!
...全文
107 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
柯本 2006-01-08
  • 打赏
  • 举报
回复
这样就可以将远程目录结构返回到memo1

procedure TForm1.Button1Click(Sender: TObject);
begin
IdFtp1.Connect();
IdFtp1.ChangeDir('/');
IdFtp1.List(memo1.Lines);
end;

结果为:(linux ftp服务器)
total 100
drwxr-xr-x 2 root root 4096 Jan 11 2003 bin
drwxr-xr-x 2 root root 4096 Jan 1 14:51 boot
drwxr-xr-x 6 root root 36864 Jan 1 14:52 dev
drwxr-xr-x 26 root root 4096 Jan 1 14:52 etc
drwxr-xr-x 4 root root 4096 May 21 2003 home
...


clasj 2006-01-08
  • 打赏
  • 举报
回复
帮顶
ly_liuyang 2006-01-06
  • 打赏
  • 举报
回复
IdFtp1.List(nil)是错误的!
List返回列表的!
没看文档的么?

汗~~

List(Alist)
结果在AList中的!
19750819 2006-01-06
  • 打赏
  • 举报
回复
我是想通过DirectoryListing.Items得到文件目录结构信息!

1,593

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 网络通信/分布式开发
社区管理员
  • 网络通信/分布式开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧