//根據年月獲取所有日期
//txt="2019-04"
public List<string> CalTime(string txt) {
DateTime beginTime=DateTime.Parse(txt+"-01");//本月初
DateTime endTime=DateTime.Parse( beginTime.AddMonths(1).AddDays(-1).ToShortDateString());//本月最後一天
List<string> dateList = new List<string>();
for (DateTime dt = beginTime; dt <= endTime; dt = dt.AddDays(1))
{
dateList .Add(dt.ToShortDateString());
}
return dateList ;
}