欧美亚洲国产日韩,国产·精品毛片,中文字幕亚洲一区二区三区http://www.aygfsteel.com/stevenjohn/category/51107.html那些青春的歲月zh-cnSat, 21 Sep 2013 08:56:54 GMTSat, 21 Sep 2013 08:56:54 GMT60Java 下載文件http://www.aygfsteel.com/stevenjohn/archive/2013/09/21/404264.htmlabinabinSat, 21 Sep 2013 08:06:00 GMThttp://www.aygfsteel.com/stevenjohn/archive/2013/09/21/404264.htmlhttp://www.aygfsteel.com/stevenjohn/comments/404264.htmlhttp://www.aygfsteel.com/stevenjohn/archive/2013/09/21/404264.html#Feedback0http://www.aygfsteel.com/stevenjohn/comments/commentRss/404264.htmlhttp://www.aygfsteel.com/stevenjohn/services/trackbacks/404264.html
   try {
            response.setContentType("application/vnd.ms-excel;charset=UTF-8");
            response.setHeader("Content-Disposition", "attachment; filename=" +teamQuery.getTeamId()+ new String(" 項目銷量.xls".getBytes("gbk"), "iso8859-1"));
            Boolean flag = manteamService.downFile(teamQuery,response.getOutputStream());
            if (flag) {
                resutMap.put("success", true);

            }

        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        } catch (IOException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
一定要有response.getOutputStream()


abin 2013-09-21 16:06 發表評論
]]>
統計某一目錄下每個文件中出現的字母個數、數字個數、空格個數及行數(JAVA) http://www.aygfsteel.com/stevenjohn/archive/2012/03/31/373167.htmlabinabinSat, 31 Mar 2012 14:02:00 GMThttp://www.aygfsteel.com/stevenjohn/archive/2012/03/31/373167.htmlhttp://www.aygfsteel.com/stevenjohn/comments/373167.htmlhttp://www.aygfsteel.com/stevenjohn/archive/2012/03/31/373167.html#Feedback0http://www.aygfsteel.com/stevenjohn/comments/commentRss/373167.htmlhttp://www.aygfsteel.com/stevenjohn/services/trackbacks/373167.htmlpackage com.abin.lee.test;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;

public class FileTotal {
 
 public static void ReadSubdirectory(File dir){
  if(dir.isDirectory()){
   File[] subFile=dir.listFiles();
   for(int i=0;i<subFile.length;i++){
    if(subFile[i].isDirectory()){
     ReadSubdirectory(subFile[i]);
    }else{
     ReadSubFile(subFile[i]);
    }
   }
  }
 }
 public static void ReadSubFile(File file){
  int numCount=0;
  int letterCount=0;
  int spaceCount=0;
  int lineCount=0;
  int temp=0;
  try {
   FileInputStream input=new FileInputStream(file);
   while((temp=input.read())!=-1){
    if(temp>=48&&temp<=57){
     numCount++;
    }else if((temp>=65&&temp<=90)||(temp>97&&temp<122)){
     letterCount++;
    }else if(temp==32){
     spaceCount++;
    }
   }
   BufferedReader buffer=new BufferedReader(new InputStreamReader(new FileInputStream(file)));
   while(buffer.readLine()!=null){
    lineCount++;
   }
   System.out.println("文件路徑:"+file.getAbsolutePath());
   System.out.println("數字個數:"+numCount);
   System.out.println("字母個數:"+letterCount);
   System.out.println("空格個數:"+spaceCount);
   System.out.println("行數數:"+lineCount);
   
  } catch (Exception e) {
   e.printStackTrace();
  }
 }
 public static void main(String[] args) {
  ReadSubdirectory(new File("D://image"));
 }
}



abin 2012-03-31 22:02 發表評論
]]>
主站蜘蛛池模板: 乌兰浩特市| 丘北县| 山东| 永寿县| 儋州市| 新津县| 萝北县| 鹿泉市| 湘乡市| 旺苍县| 广灵县| 双鸭山市| 洮南市| 闽清县| 雷山县| 吴堡县| 太保市| 乐东| 顺义区| 左权县| 泾川县| 汉阴县| 毕节市| 电白县| 随州市| 葫芦岛市| 东丽区| 壤塘县| 阿拉善左旗| 额济纳旗| 襄汾县| 德令哈市| 武宁县| 尼玛县| 太原市| 琼海市| 陆良县| 津南区| 大同市| 依兰县| 安龙县|