public int TotalWeeks( DateTime AStart, DateTime AEnd, DayOfWeek AWeek)
{
TimeSpan vTimeSpan = new TimeSpan (AEnd . Ticks - AStart . Ticks);
int Result = ( int )vTimeSpan . TotalDays / 7 ;
for ( int i = 0 ; i <= vTimeSpan . TotalDays % 7 ; i ++ )
if (AStart . AddDays(i) . DayOfWeek == AWeek)
return Result + 1 ;
return Result;
} /* TotalWeeks */