DirectoryInfo di = new DirectoryInfo(path);
FileInfo[] fileInfos = di.GetFiles("5310*.txt", SearchOption.AllDirectories);这个文件读出来的数假如是5000,而用window直接搜索出来的结果就和这个不一致。为什么为出现这种状况,另链接一个同样的问题:
http://wenwen.soso.com/z/q349129397.htmbugc#GetFiles微软bug
FileInfo[] fileInfos = di.GetFiles("5310*.txt", SearchOption.AllDirectories);这个文件读出来的数假如是5000,而用window直接搜索出来的结果就和这个不一致。为什么为出现这种状况,另链接一个同样的问题:
http://wenwen.soso.com/z/q349129397.htmbugc#GetFiles微软bug
FileInfo[] fileInfos = di.GetFiles("*.*", SearchOption.AllDirectories).Where(x => RegEx.IsMatch(x.FileName.ToLower(), @"5310\w*.txt")).ToArray();