package com.qzkj.IO;

import java.io.File;

public class FileDemo2 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		File f = new File("E:\\");
		if(f.isDirectory()){
			System.out.println("是目录:"+f.getPath());
			//不会列出路径 返回类型为String型
			String s[] = f.list();
			//指定目录的全部内容,会列出路径 返回类型为File型
			File s1[] = f.listFiles();
			for (int i=0;i<20;i++){
				System.out.println(s[i]);
			}
		}else{
			System.out.println("不是目录:"+f.getPath());
		}

	}

}
最近下载更多
wjdxsj  LV1 2020年11月2日
chenqiwax  LV4 2019年8月2日
han108  LV16 2019年3月6日
飞翔的企鹅嗯嗯  LV11 2019年1月30日
localhost1  LV1 2018年7月4日
都是老虎啊  LV12 2018年6月25日
925386146  LV1 2017年8月8日
wade123  LV31 2014年11月7日
最近浏览更多
heqian  LV16 2023年1月10日
任家毅  LV1 2021年6月1日
微量的记忆  LV10 2021年4月12日
wjdxsj  LV1 2020年11月2日
yhj123  LV2 2020年6月19日
jsjlvpan  LV1 2019年9月18日
废人a123456789 2019年8月6日
暂无贡献等级
chenqiwax  LV4 2019年8月2日
cheeseni  LV1 2019年7月6日
飞翔的企鹅嗯嗯  LV11 2019年1月30日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友