package JB2015;
import java.io.File;
public class AG {
public static void main(String[] args) {
File Srcfile = new File("D:\\untitled\\src\\JB2015");
getAllFilePath(Srcfile);
}
public static void getAllFilePath(File Srcfile) {
File[] files = Srcfile.listFiles();
if (Srcfile != null) {//目录不为空才继续
for (File file : files //增强for循环输出文件目录下的文件
) {
if (file.isDirectory()){
getAllFilePath(file); //如果文件为目录 就递归
}
else {
System.out.println(file.getAbsoluteFile());
}
}
}
}
}
12-16
762
11-18
374
06-20
317