C# 获取某目录下的全部文件

using System;
using System.Collections.Generic;
using System.IO;

private List<string> finded_files = new List<string>();
private void RecursiveGetFiles(string parent_path)
{
    string[] files = Directory.GetFiles(parent_path);
    foreach (string file in files)
    {
        // 这里能够进行文件的过滤,好比筛选指定的后缀
        finded_files.Add(file);
    }
    string[] paths = Directory.GetDirectories(parent_path);
    foreach (string path in paths)
    {
        RecursiveGetFiles(path);
    }
}