使用Commons-net包编写FTP客户端出现异常。
使用Commons-net包编写FTP客户端出现异常。
ftp = new FTPClient();ftp.connect(FTP_SERVER_HOST, FTP_SERVER_PORT);// 登录ftp.login(FTP_SERVER_USER, FTP_SERVER_PASS);reply = ftp.getReplyCode();System.out.println(reply);if (!FTPReply.isPositiveCompletion(reply)) { ftp.disconnect(); System.err.println("FTP server refused connection."); System.exit(1);}
结果是ReplyCode始终打印出代码:230 1 楼 johnnyhg 2007-11-07 自己顶一下 2 楼 johnnyhg 2007-11-07 230表示没有接收到数据 3 楼 johnnyhg 2007-11-07 要注意使用多线程来接受数据