日期:2014-05-18 浏览次数:20820 次
try {
FTPClient ftp = new FTPClient();
ftp.connect("192.168.1.174",22);
ftp.login("abc", "111");
int reply = ftp.getReplyCode();
if (!FTPReply.isPositiveCompletion(reply)) {
ftp.disconnect();
return "success";
}
} catch (IOException e) {
e.printStackTrace();
} finally {
if (ftp.isConnected()) {
try {
ftp.disconnect();
} catch (IOException ioe) {}
}
}