DirectoryInfo dir = new DirectoryInfo(@"D:\VS2012Project\测试用例\");
foreach (FileInfo file in dir.GetFiles("*.rar", SearchOption.AllDirectories))//第二个参数表示搜索包含子目录中的文件;
{
if (file.Name.Contains("2015"))
MessageBox.Show(file.Name);
}