Un metodo del genere
Codice:
int nYears(DateTime start, DateTime end)
{
return (end.Year - start.Year - 1) +
(((end.Month > start.Month) ||
((end.Month == start.Month) && (end.Day >= start.Day))) ? 1 : 0);
}
da chiamare passando le due date
Codice:
anni = nYears(Data_Nascita, DateTime.Now);