itoracja 发表于 2013-2-3 11:29:29

递归遍历文件

public static void getfile(file file){if(file == null){return;}if(file.isdirectory()){string[] files = file.list();for(int i=0; i<files.length;i++){getfile(new file(file,files));}}else{if(file.getabsolutepath().endswith(".html")&&file.getname().matches("*.html")){system.out.println(file);count++;}}}
页: [1]
查看完整版本: 递归遍历文件