DateTime DT1=Convert.ToDateTime("2005-04-01");
DateTime DT2=Convert.ToDateTime("2001-12-28");
int i=(Convert.ToInt32(DT1.Year.ToString())-Convert.ToInt32(DT2.Year.ToString()))*12;
int j=Convert.ToInt32(DT1.Month.ToString())-Convert.ToInt32(DT2.Month.ToString());
int x=i+j;
x就是月数