1

In explorer, you can sort files by the following metadata fields

  • date
  • date created
  • date modified
  • date taken
  • etc.

In C# I only have access to these

  • FileInfo.LastWriteTime
  • FileInfo.CreationTime and
  • FileInfo.LastAccessTime

I'm not quite sure what the 'date' column actually is in explorer, for some files it is equal to date modified, but for others 'date' is older than 'date modified'.

How do I sort by 'date' in C#?

Simon Verbeke
  • 2,905
  • 8
  • 36
  • 55

1 Answers1

1

'Date' in Explorer is almost always the same as 'Date Modified', the exception being if a 'Date' is exposed via a files Extended Properties.

To read the Extended Properties of a file requires using some COM components exposed by Shell32 - there's no way to do this in pure C#. There's a general purpose to answer on how to read a files extended properties via Shell32 here: Read/Write 'Extended' file properties (C#)

PhonicUK
  • 13,486
  • 4
  • 43
  • 62