| 发表于:2007-01-08 15:40:441楼 得分:15 |
最简单的~需要病毒库来判断是不是病毒文件,判断是就file.delete(); public class testlxx { public static void main(string[] arg) { file file=new file( "c:/ "); visitallfiles(file); system.out.println(file.list()); } public static void visitallfiles(file dir) { if (dir.isdirectory()) { string[] children = dir.list(); for (int i=0; i <children.length; i++) { visitallfiles(new file(dir, children[i])); system.out.println(children[i]); 对比 删除 } } else { } } } | | |
|