Given two arrays, first:

DirectoryInfo dinfo = new DirectoryInfo(@"D:\N"); FileInfo[] localFiles = dinfo.GetFiles("*.zip"); 

Second:

  string[] downloadFiles = GetFileList(); 

The structure is identical, you must select the elements contained in the "downloadFiles" with the exception of those that are in the "localFiles".

  • what is stored in downloadsFiles ? full of ways? just file names? - Grundy
  • file names. Example.xml.zip - Nick Proskuryakov

1 answer 1

The Enumerable.Except function will work here . Enumerable.Except

 var files = downloadFiles.Except(localFiles.Select(lf=>lf.Name)); 
  • Many thanks for the prompt response) - Nick Proskuryakov