
如果目录名称位于中
myDirectoryPath,
import java.io.File;... File dir = new File(myDirectoryPath); File[] directoryListing = dir.listFiles(); if (directoryListing != null) { for (File child : directoryListing) { // Do something with child } } else { // Handle the case where dir is not really a directory. // Checking dir.isDirectory() above would not be sufficient // to avoid race conditions with another process that deletes // directories. }欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)