2个回答
展开全部
file.listFiles();
--------------------------------------------------------------------
static void ListFilesInDirectory(String path ) {
File file = new File(path);
File[] files = file.listFiles();
for (File fl : files) {
if (fl.isDirectory())
ListFilesInDirectory(fl.toString());
else
System.out.println(fl.getName());
}
}
--------------------------------------------------------------------
static void ListFilesInDirectory(String path ) {
File file = new File(path);
File[] files = file.listFiles();
for (File fl : files) {
if (fl.isDirectory())
ListFilesInDirectory(fl.toString());
else
System.out.println(fl.getName());
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询