复制代码 代码如下:
List<FileInfo> garbagePicList = new List<FileInfo>();
for (int k = 0; k < fiAllPicList.Length; k++)
{
bool found = false;
for (int l = 0; l < usedPicList.Count; l++)
{
if (fiAllPicList[k].Name == usedPicList[l].ToString())
{
found = true;
}
}
if (!found)
{
garbagePicList.Add(fiAllPicList[k]);
}
}
复制代码 代码如下:
List<FileInfo> garbagePicList = new List<FileInfo>();
var query = from pic in fiAllPicList
where !usedPicList.Contains(pic.Name)
select pic;
garbagePicList = query.ToList();
新闻热点
疑难解答
图片精选