这样可靠一些:
Dim y As Integer = Date.Today.YearDim m As Integer = Date.Today.MonthDim dt1 As New Date(y, m, 1)dt1 = dt1.Addmonths(-1)y = dt1.Yearm = Dt1.MonthDim dt2 As New Date(y, m, Date.DaysInMonth(y, m))