String contentperline; try{ a="粘贴成功!"; String fg =new String("\\"); int index = filepathname.lastIndexOf(fg); String filename = filepathname.substring(index+1); File localFile ; localFile = new File(filepathname) ; RandomAccessFile sendFile = new RandomAccessFile(filepathname,"r"); // sendFile.seek(0); outs = aftp.put(filename); outputs = new DataOutputStream(outs); while (sendFile.getFilePointer() < sendFile.length() ) { ch = sendFile.read(); outputs.write(ch); } outs.close(); sendFile.close(); } catch(IOException e){ a = "粘贴失败!"; result = false ; } LblPrompt.setText(a); showFileContents(); } else{ result = false; } return result; } |
闁衡偓閹増顥戦柟瀛樺姇婵拷闁哄被鍎冲﹢鍛村绩閹増顥�>>
正在阅读:Java实现ftp功能Java实现ftp功能
2004-04-05 14:41
出处:Javajia
责任编辑:sdq
键盘也能翻页,试试“← →”键