import com.enterprisedt.net.ftp.FTPException;
import com.enterprisedt.net.ftp.FTPClient;
import com.enterprisedt.net.ftp.FTPTransferType;
import com.enterprisedt.net.ftp.FTPConnectMode;

解决方案 »

  1.   

    如果你要FTP.jar的话,请给我邮件[email protected]
      

  2.   

    这个我有,但感觉不如inetfactory.jar(可惜不免费)方便,但我还是谢谢你
      

  3.   

    sun提供sun.net.ftp.FTPClient类
    显示FTP服务器上的文件 void ftpList_actionPerformed(ActionEvent e) {
     String server=serverEdit.getText();//输入的FTP服务器的IP地址
        String user=userEdit.getText();    file://登录FTP服务器的用户名
        String password=passwordEdit.getText();//登录FTP服务器的用户名的口令
        String path=pathEdit.getText();//FTP服务器上的路径
        try {
        FtpClient ftpClient=new FtpClient();//创建FtpClient对象
        ftpClient.openServer(server);//连接FTP服务器
        ftpClient.login(user, password);//登录FTP服务器
           if (path.length()!=0) ftpClient.cd(path);
        TelnetInputStream is=ftpClient.list();
        int c;
        while ((c=is.read())!=-1) {
      System.out.print((char) c);}
                    is.close();
                    ftpClient.closeServer();//退出FTP服务器
             } catch (IOException ex) {;}
      }