国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

拷貝文件的源代碼

2019-11-17 06:09:56
字體:
來源:轉載
供稿:網友

  //-----------Class CopyFile Begin---------
  //Class CopyFile
  //CopyRight:Writed By Yun-Fengsheng 
  //Last modify time:2001-11-16

  //Method: public boolean copy(String from_filename,String to_filename)

  class CopyFile
  {
   public boolean copy(String file1,String file2)
   {
    try //must try and catch,otherwide will compile error
       {
    //instance the File as file_in and file_out
    java.io.File file_in=new java.io.File(file1);
    java.io.File file_out=new java.io.File(file2);
    FileInputStream in1=new FileInputStream(file_in);
          FileOutputStream out1=new FileOutputStream(file_out);
    byte[] bytes=new byte[1024];
    int c;
    while((c=in1.read(bytes))!=-1)
     out1.write(bytes,0,c);
    in1.close();
    out1.close();
    return(true);  //if sUCcess then return true
          }

      catch(Exception e)
         {  
      System.out.jsp","c:/hello_backup.jsp");
  if(copy_ok)
  {
   out.println("拷貝成功!");
  }
  else
  {
   out.println("拷貝失敗!");
  }
  */
  //-----------Class CopyFile End-----------

進入討論組討論。


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 金沙县| 轮台县| 绥中县| 富蕴县| 陆良县| 临猗县| 博客| 介休市| 彰武县| 沙洋县| 前郭尔| 穆棱市| 始兴县| 安泽县| 天全县| 河曲县| 禹州市| 襄汾县| 屯昌县| 囊谦县| 慈利县| 兴宁市| 武川县| 白山市| 尼玛县| 凤冈县| 新田县| 托克逊县| 寿光市| 延寿县| 塔城市| 罗田县| 峨边| 揭东县| 宣城市| 灯塔市| 大埔县| 东丽区| 黔南| 丰原市| 务川|