我只想为一年中的每个月创建一个类似这样的文本(链接)
May, 2013
April, 2013
March, 2013
February, 2013
January, 2013
December, 2012
为此,我创建了这个 for 循环
var start = DateTime.Now;
var end = DateTime.Now.AddYears(20);
for (DateTime time = start; time <= end; time = time.AddMonths(1))
{
//month and year
}
但我不确定,因为它不起作用:(