posts - 75,comments - 83,trackbacks - 0
          <2008年1月>
          303112345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          常用鏈接

          留言簿(6)

          隨筆分類(52)

          隨筆檔案(75)

          文章分類(12)

          文章檔案(15)

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

           public static void CopyFile(File in, File out) throws Exception {
                  
          try {
                      FileInputStream fis 
          = new FileInputStream(in);
                      FileOutputStream fos 
          = new FileOutputStream(out);
                      
          byte[] buf = new byte[1024];
                      
          int i = 0;
                      
          while ((i = fis.read(buf)) != -1{
                          fos.write(buf, 
          0, i);
                      }

                      fis.close();
                      fos.close();
                  }
           catch (Exception ex) {
                      ex.printStackTrace();
                  }

              }
           String imgFinallyPath = uploadImgPath + java.io.File.separator +maxNewsId;
                           File allFile 
          = new File(uploadImgPath) ;
                           File imgFinallyFile 
          = new File(imgFinallyPath);
                           File[] arrayFile 
          = allFile.listFiles(); //得到web/adimn_inc_upload_news文件夾下的所有文件
                           long currTime = System.currentTimeMillis();
                          
          if (!imgFinallyFile.exists()) {  //創建以ID為名的文件夾
                                  imgFinallyFile.mkdirs();
                              }

                          
          //對當前目錄下面所有文件進行檢索
                           for(int i=0;i<arrayFile.length;i++){
                               
          if(arrayFile[i].isFile()){
                                  String fileName 
          = arrayFile[i].getName(); 
                               }

                           }
          posted on 2008-01-16 14:15 梓楓 閱讀(229) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 舞阳县| 措美县| 新竹市| 广宁县| 佛冈县| 老河口市| 曲水县| 彭州市| 育儿| 富民县| 仙居县| 鹤山市| 香港| 彭泽县| 嵩明县| 铜川市| 克拉玛依市| 万山特区| 伊吾县| 辽阳市| 依兰县| 鹰潭市| 江陵县| 江津市| 加查县| 铜梁县| 六安市| 龙游县| 太保市| 银川市| 营山县| 滁州市| 平塘县| 荥阳市| 莫力| 定襄县| 韩城市| 苏尼特右旗| 偏关县| 焦作市| 奎屯市|