public static int GetAge(string idcard)
{
if (string.IsNullOrEmpty(idcard) || idcard.Length != 18)
return 0;
int x = Convert.ToInt32(idcard.Substring(6, 4));
int y = DateTime.Now.Year;
return y - x;
}
{
if (string.IsNullOrEmpty(idcard) || idcard.Length != 18)
return 0;
int x = Convert.ToInt32(idcard.Substring(6, 4));
int y = DateTime.Now.Year;
return y - x;
}