如上。

解决方案 »

  1.   

    DateTime dt = Convert.ToDateTime( string );
    dt.Month = dt.Month + 1;
    dt.Day = 1;
    dt.AddDay( -1 );
    这个时候的Day就是该月的天数了……
    我记得好像有更好的办法,忘记了,等后面的人来吧。
      

  2.   

    找到了DateTime.DaysInMonth( DateTime )
    返回指定年份中指定月份的天数
      

  3.   

    DateTime dt = Convert.ToDateTime( string );
    int intDays=DateTime.DaysInMonth( DateTime );
    返回指定年份中指定月份的天数
      

  4.   

    public static System.Int32 DaysInMonth ( System.Int32 year , System.Int32 month )
        System.DateTime 的成员摘要:
     返回指定年份中指定月份的天数。  参数:
    year: 年份。 
    month: 月份(介于 1 到 12 之间的一个数字)。 返回值:
     指定 year 中 month 的天数。   例如,如果 month 等于 2(表示二月),则返回值为 28 或 29,具体取决于 year 是否为闰年。  异常:
    System.ArgumentOutOfRangeException: month 小于 1 或大于 12。 
      

  5.   

    DateTime dt = Convert.ToDateTime( string );
    int intDays=DateTime.DaysInMonth( dt.Year,dt.Month);
    返回指定年份中指定月份的天数
      

  6.   

    DateTime dt = Convert.ToDateTime( string );
    int Days=DateTime.DaysInMonth( DateTime );