生成文本文件,通过FTP上传到服务器上,但发现上传后,文本丢失内容!请大家帮忙!
解决方案 »
- if (rs.getString(3)=="管理员")这个地方为什么不能比较
- 自定义JTextField组件问题
- 如何程序中捕获异常,查看异常抛出的位置或不捕获异常,将异常往上传递。
- 小小问题?请问那里出错了?
- 专题探讨:《如何能高效率的返回在接口方法里接收的数据》
- 其中ex.printStackTrace(); 是跟踪信息用的,我想问的是他打印出的信息在什么地方可以看到阿。
- 帮帮忙!!!请问在javascript中判断字符串中包含某一特定字符
- 那里还有人气较旺的有关java的论坛
- Applet 编译
- 为什么c输出的不是65
- 请问:throws 与 try{ }catch() 到底有什么区别??
- 求助,问题出在哪里?
String user=Config.getInstance().getConfigItem("UeSoftFtpUser");
String password=Config.getInstance().getConfigItem("UeSoftFtpPass");
String path=Config.getInstance().getConfigItem(model+"_response");
String filename=billFiledir + billFileName;
System.out.println("filename = "+filename);
try {
FtpClient ftpClient=new FtpClient();
ftpClient.openServer(server);
ftpClient.login(user, password);
System.out.println("====="+ftpClient.pwd() + "/" +model + "/response/");
ftpClient.cd(ftpClient.pwd() + "/" +model + "/response/");
ftpClient.binary();
TelnetOutputStream os=ftpClient.put(billFileName);
File file_in=new File(filename);
FileInputStream is=new FileInputStream(file_in);
byte[] bytes=new byte[1024];
int c;
while ((c=is.read(bytes))!=-1){
os.write(bytes,0,c);}
is.close();
os.close();
ftpClient.closeServer();
} catch (IOException ex) {
System.out.println("ex=="+ex);
}这是代码