正在阅读:Java实现ftp功能Java实现ftp功能

2004-04-05 14:41 出处:Javajia 作者:Javajia 责任编辑:sdq

  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;
  }

察看评论详细内容 我要发表评论
作者笔名简短内容 发表时间
:

键盘也能翻页,试试“← →”键

相关文章

关注我们

最新资讯离线随时看 聊天吐槽赢奖品