使用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
评论
johnnyhg 2007-11-07
要注意使用多线程来接受数据
johnnyhg 2007-11-07
230表示没有接收到数据
johnnyhg 2007-11-07
自己顶一下
johnnyhg
搜索本博客
我的相册
07184f93-fa2b-330e-9922-fc26260b2319-thumb
独醉
共 1 张
存档
最新评论