The DateTimeFilter class can be used to filter files and folder according to their dates. By default, if a specific type of date is not specified (last accessed, creation, etc.), the last write date is consulted.
Demonstration
Process all files that have a last write date between January 1st 1999 and January 1st 2001.
VB.NET | Copy Code |
---|---|
|
C# | Copy Code |
---|---|
|
Process all files that have a last accessed date between January 1st 1999 and January 1st 2001.
VB.NET | Copy Code |
---|---|
|
C# | Copy Code |
---|---|
|
Things you should consider
-
Do you only want to target specific types of folder items? Use the FilterScope enumeration in the constructor of the DateTimeFilter class.
-
Do you want to filter according to a specific type of date? Use the ApplicableDateTimes enumeration in the constructor of the DateTimeFilter class.