国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

每日一題(4):

2019-11-09 19:29:24
字體:
來源:轉載
供稿:網友

獲取指定目錄下所有文件的名稱 

package demo;import java.io.File;/** * Created by asus on 2017/2/9. */public class FileName {    public static void main(String[] args) {        String path = "D://學習文件//開題";//指定打開文件的目錄地址        getFile(path);    }    PRivate static void getFile(String path){        // get file list where the path has        File file = new File(path);        // get the folder list        File[] array = file.listFiles();        for(int i=0;i<array.length;i++){            if(array[i].isFile()){                // only take file name                System.out.println("^^文件名^^^" + array[i].getName());                // take file path and name                System.out.println("##內容###" + array[i]);                // take file path and name                System.out.println("**路徑***" + array[i].getPath());            }else if(array[i].isDirectory()){                getFile(array[i].getPath());            }        }    }}


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 北碚区| 林口县| 鄂托克前旗| 景洪市| 睢宁县| 布尔津县| 鸡泽县| 额尔古纳市| 镇远县| 海兴县| 福建省| 安西县| 元谋县| 图片| 沙河市| 宁乡县| 香河县| 报价| 盘山县| 郓城县| 兴安县| 舒兰市| 托克逊县| 高阳县| 阳曲县| 连云港市| 萨迦县| 嘉义县| 贵南县| 巫溪县| 娱乐| 凉山| 彰化市| 江津市| 二连浩特市| 溧阳市| 太和县| 哈巴河县| 乐亭县| 星子县| 普安县|