递归显示指定文件夹下面的文件

using System;
using System.IO;

class Program
{
    static void Main()
    {
        string[] files = Directory.GetFiles("D:\\快盘\\",
            "*.*",
            SearchOption.AllDirectories);
        foreach (string file in files)
        {
            Console.WriteLine(file);
        }
    }
}

http://www.dotnetperls.com/recursive-file-list
posted @ 2012-08-07 20:24  gitran  阅读(222)  评论(0编辑  收藏  举报