}
我用的是org.apache.commons.net.ftp.*;这个包
FTPClient f = new FTPClient();
f.connect(server);
f.login(username, password);
System.out.println(f.printWorkingDirectory());
if (f.isConnected()){
JFileChooser chooser = new JFileChooser();
if (chooser.showOpenDialog(null) != JFileChooser.APPROVE_OPTION)
return;
File fi = chooser.getSelectedFile();
}
else{
JOptionPane.showMessageDialog(null, "Connot Connect! ");
System.exit(0);
}
------解决方案--------------------
up