I'm trying to display an Excel file that was created last week, between Monday-Friday. For instance, if it's Monday, I would like to look for files between last Monday and Friday. If it's Friday of the same week, I want to query the same time frame.
I know the following code will give me yesterday results, but how would I get a date range? Thanks.
string[] files = Directory.GetFiles(FBD.SelectedPath, "*.xls")
.Where(file => new FileInfo(file).CreationTime.Date == DateTime.Today.AddDays(-1))
.ToArray();