Thursday, 17 May 2018

Directory.GetFiles () Order By Date

  1. using System.Linq;
  2.  
  3. DirectoryInfo info = new DirectoryInfo("");
  4. FileInfo[] files = info.GetFiles().OrderBy(=> p.CreationTime).ToArray();
  5. foreach (FileInfo file in files)
  6. {
  7.     // DO Something...
  8. }

No comments:

Post a Comment

Note: only a member of this blog may post a comment.