我有两个List< FileInfo>我想在它们之间返回公共FileItem.
List<FileInfo> outputList = new List<FileInfo>(); outputList = list1.Intersect(list2).ToList();
但是,我要回到一个空列表.
这两个列表都包含找到的FileInfo
System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo(startFolder); IEnumerable<System.IO.FileInfo> fileList = dir.GetFiles("*.*",System.IO.SearchOption.AllDirectories);
并通过查询过滤.