我做了一个ftp客户端的程序,现在想在客户端显示ftp服务器端的文件目录,请问怎么实现啊!大家能够给我一些有原码的网址也可以啊! 不胜感激!!!

解决方案 »

  1.   

    http://dev.csdn.net/develop/article/51/51576.shtm
      

  2.   

    去  http://www.enterprisedt.com/ 下载edtftpj-1.5.2.jar;
    FTPClient fTPClient = new FTPClient(yourftpIp, 21);
    fTPClient.login(userName, password);
    fTPClient.setType(FTPTransferType.BINARY);
    String[] dirList=fTPClient.dir(yourPath);//如果yourPath=/temp/,则dirList里面是temp目录下的所有子目录,包括文件
    循环遍历取出来dirList的值