当前月份的第一天和最后一天
DateTime current_day = dateTimePicker1.Value;
DateTime first_day = current_day.AddDays(1 - current_day.Day);
DateTime last_day = current_day.AddDays(1 - current_day.Day).AddMonths(1).AddDays(-1);
上个月的第一天和最后一天
DateTime current_day = dateTimePicker1.Value;
DateTime first_day = current_day.AddDays(1 - current_day.Day).AddMonths(-1);
DateTime last_day = current_day.AddDays(1 - current_day.Day).AddDays(-1);