string MonthList = "";
for (DateTime i = BeginTime; i <= EndTime; i.AddMonths(1))
{
MonthList += "'" + i.Month + "月',";
}
if (MonthList.Length > 0)
{
MonthList = MonthList.Remove(MonthList.Length - 1, 1);
}
return MonthList = "[" + MonthList + "]";
C#里面写for循环,for然后tab tab 框架就出来了,然后时间赋值,加一个月,感觉没什么问题,结果就坑了。。
for循环的i++ 写成时间是 i = i.AddMonths(1) ,老是忘记,就把IIS给搞死了。。CPU100%
string MonthList = "";
for (DateTime i = BeginTime; i <= EndTime; i = i.AddMonths(1))
{
MonthList += "'" + i.Month + "月',";
}
if (MonthList.Length > 0)
{
MonthList = MonthList.Remove(MonthList.Length - 1, 1);
}
return MonthList = "[" + MonthList + "]";