package com.henu.util;

import java.io.File;

public class TakeFilePathAndName {

    public static void main(String[] args) {
// This is the path where the file's name you want to take.
String path = "C://Documents and Settings//yinxm//デスクトップ//TestFile";
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());
}
}
}
}

最新文章

  1. Oracle基础维护02-表、主键、索引、表结构维护手册
  2. Tomcat:基于Apache+Tomcat的集群搭建
  3. Unity Shader入门基础(一)
  4. 转simhash与重复信息识别
  5. U3D各路径实例
  6. mysql数据导入
  7. 【英语】Bingo口语笔记(64) - Beat系列
  8. 使用EMMET中的小坑
  9. Linux 查看文件内容的命令
  10. c++11 线程:让你的多线程任务更轻松
  11. unity节目素材ProceduralMaterial采用
  12. Struts2从头到脚--学习笔记(自认为比较重要的)
  13. Mysql的学习笔记(一)--检验数据库是否安装成功以及一些入门的简单的dos命令
  14. C语言第三次程序设计作业
  15. ansj原子切分和全切分
  16. Python3 tkinter基础 Text window 文本框中插入按钮
  17. Atom插件安装及推荐
  18. docker 命令集
  19. 一图解释PHPstorm代码片段设置---附官方文档(转)
  20. numpy的ravel()和flatten()函数比较

热门文章

  1. MOD 10,11算法(GB/T 17710-1999 数据处理 校验码系统 )的 Python实现
  2. ARM 内核
  3. windows下thrift的使用(C++)
  4. C# String.Format 格式化字符串 数字/时间
  5. BZOJ.2428.[HAOI2006]均分数据(随机化贪心/模拟退火)
  6. hdu 2819 记录路径的二分匹配
  7. 拆分Cocos2dx渲染部分代码
  8. PAT甲级1127. ZigZagging on a Tree
  9. 基于Landmark的人脸对齐以及裁剪方法
  10. python模块整理30-uui模块