显示FTP服务器上的文件,这只是在控制台上显示,因为我只需要这样。
不过我想,如果你想分辨的话,可以分析一下字符串void ftpList_actionPerformed(ActionEvent e) {
String server=serverEdit.getText();
//输入的FTP服务器的IP地址
String user=userEdit.getText();
//登录FTP服务器的用户名
String password=passwordEdit.getText();
//登录FTP服务器的用户名的口令
String path=pathEdit.getText(); try {
FtpClient ftpClient=new FtpClient(); ftpClient.openServer(server); ftpClient.login(user, password); 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();
} catch (IOException ex) {;}
}
不过我想,如果你想分辨的话,可以分析一下字符串void ftpList_actionPerformed(ActionEvent e) {
String server=serverEdit.getText();
//输入的FTP服务器的IP地址
String user=userEdit.getText();
//登录FTP服务器的用户名
String password=passwordEdit.getText();
//登录FTP服务器的用户名的口令
String path=pathEdit.getText(); try {
FtpClient ftpClient=new FtpClient(); ftpClient.openServer(server); ftpClient.login(user, password); 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();
} catch (IOException ex) {;}
}
就像flashget的站点资源管理器,或是leapftp一样