Get a date field into a variable using DateTime.TryParse ie.
TryParse(20120219);
.
Then just use the
DateTime.DaysInMonth
method[
^] to get the number of days in this month (the month and year argument can be passed using the variable output).
e.g.
DateTime.TryParse(filename,dtLocalDate);
int daysInMonth = DateTime.DaysInMonth(dtLocalDate.Year, dtLocalDate.Month);
if (daysInMonth == dtLocalDate.Day)
{
}