java获取指定文件夹下的所有文件名

您所在的位置:网站首页 eclipse查找文件名 java获取指定文件夹下的所有文件名

java获取指定文件夹下的所有文件名

#java获取指定文件夹下的所有文件名| 来源: 网络整理| 查看: 265

原文链接:

package Test; import java.io.File; /** * @author yinxm * @version 1.0 2005/06/17 * * This class can take file's path and file's name; * you must give the path where you want to take the 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


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3