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

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

每日一題(4):

2019-11-10 17:12:13
字體:
來源:轉載
供稿:網友

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

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


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 土默特左旗| 新河县| 武乡县| 靖边县| 宜阳县| 特克斯县| 瑞安市| 沙湾县| 湛江市| 都江堰市| 宁城县| 临颍县| 东城区| 嘉定区| 霍城县| 新建县| 友谊县| 信宜市| 安康市| 原阳县| 霞浦县| 宝应县| 镇沅| 洛阳市| 榆树市| 崇阳县| 万荣县| 西乌| 武宁县| 石楼县| 济源市| 政和县| 揭阳市| 灵台县| 娱乐| 台中县| 航空| 泗阳县| 邹平县| 华亭县| 特克斯县|