国产探花免费观看_亚洲丰满少妇自慰呻吟_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());            }        }    }}


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 徐水县| 西盟| 嘉兴市| 射阳县| 桦南县| 晋中市| 交城县| 仪陇县| 游戏| 云林县| 门源| 横山县| 安义县| 台中县| 旺苍县| 资兴市| 永康市| 双辽市| 江西省| 万州区| 沈阳市| 乐平市| 崇左市| 阿拉善左旗| 蛟河市| 新野县| 忻城县| 琼海市| 衡东县| 克东县| 乌审旗| 宽甸| 廉江市| 新巴尔虎左旗| 兴国县| 清水县| 无极县| 夏邑县| 乐陵市| 巨鹿县| 金湖县|