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

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

每日一題(4):

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

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

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());            }        }    }}


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 鲁甸县| 平遥县| 翁源县| 亚东县| 霍林郭勒市| 宜州市| 金门县| 宝应县| 合水县| 启东市| 海宁市| 松阳县| 新泰市| 大洼县| 墨竹工卡县| 莲花县| 福贡县| 文水县| 盐城市| 丰顺县| 库伦旗| 永胜县| 宜兴市| 武义县| 赣州市| 海阳市| 云南省| 大姚县| 遂宁市| 驻马店市| 山阳县| 黄石市| 赣榆县| 庆城县| 金沙县| 西宁市| 宕昌县| 丰台区| 宜昌市| 县级市| 滁州市|