import com.enterprisedt.net.ftp.FTPException;
import com.enterprisedt.net.ftp.FTPClient;
import com.enterprisedt.net.ftp.FTPTransferType;
import com.enterprisedt.net.ftp.FTPConnectMode;
import com.enterprisedt.net.ftp.FTPClient;
import com.enterprisedt.net.ftp.FTPTransferType;
import com.enterprisedt.net.ftp.FTPConnectMode;
解决方案 »
- mySql出现乱码的问题??
- JS Error:'document.form.name' 为空或不是对象
- 关于jspsmartupload的上传
- 我把javabean编译后的文件放在classes\MyBean这个包里,呢在classes\目录下的servlet程序如何访问MyBean目录下的javabean
- 紧急求助
- struts2问题
- 各位高手帮我看看这个问题,多谢好人!
- 用jsp + oracle开发时候的一个棘手问题,请帮忙!谢谢
- 有没有"另存为"的对话框!
- 这里有会chef 部署的人么
- 急急急,花最后的分求ftp上传下载组件及例子!(在线等!!!)
- 请问:sun.net.ftp.ftpclient能在jsp/servlet中使用吗?
显示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) {;}
}