I'll try to give you some hints on how you could attempt to solve this.
- Create a class called
DateCheck
with two properties DateTime Date
and bool IsPresent
- Create a dictionary
Dictionary<datetime,>
and running throug the days of one month fill the dictionary where the key is the current date in the loop and the value is an instance of DateCheck with Date also set to the current date and IsPresent set to false (that could also be done in the constructor of DateCheck
). - Read in the file with the dates in it line by line and:
- Parse the date from the line you read from the file (
DateTime.TryParse
or DateTime.Parse
) - Lookup the value in the dictionary that is associated with the date you found in the file
- Set IsPresent to true for the value you looked up in the previous step
- Iterate over all the values in the dictionary and collect all instances of
DateCheck
where IsPresent is false
.
And you're pretty much done!
Give it a try, you'll work it out all right.
— ManfredP.S: The filtering of the values from the dictionary could be done by using a LinQ query.