标签:file
public class CreatFile {
public static void main (String[] args){
File f=new File("E:\\");
File list[]=f.listFiles();
for(int i=0;i<list.length;i++)
{
if (list[i].isDirectory())
{
System.out.println("目录名:"+list[i].getName()+list[i].getPath());
File f2=new File(list[i].getPath());
File list2[]=f2.listFiles();
continue;
}else
{
System.out.println("文件名:"+list[i].getName()+"文件大小:"+(list[i].length())/1024+"KB");
}
}
}
}
标签:file
原文地址:http://everydaygo.blog.51cto.com/4406815/1529807