1: 递归 http://blog.csdn.net/ever_snow/article/details/7219416
2:DirectoryInfo类 这里以获取test文件夹及其子目录下的所有.jpg文件为例:
1 DirectoryInfo directory = new DirectoryInfo("D:\\test"); 2 FileInfo[] files = directory.GetFiles("*.jpg", SearchOption.AllDirectories); 3 foreach (FileInfo dire in files) 4 { 5 MessageBox.Show(dire.FullName); 6 }