import java.io.File;
public class FileTest {
public static void main(String[] args) {
File myFile = new File("C:" + File.separator);
for(String s: myFile.list()){
System.out.println(s);
}
}
/**360Rec
360SANDBOX
AUTOEXEC.BAT
BOOT
boot.ini
bootfont.bin
desktop.ini
Documents and Settings
FavoriteVideo
grldr
huanjue2boot.bak
log.txt
menu.lst
mysql_script
NTDETECT.COM
ntldr
pagefile.sys
Program Files
RECYCLER
System Volume Information
Temp
WINDOWS
祖国您好窗口.history
*
*/
}
File List()列出文件目录
最新推荐文章于 2021-03-25 21:13:40 发布