日期:2014-05-18 浏览次数:21104 次
return Enumerable.Range(-7, 7).Select(x => d.AddDays(x).ToString()).ToArray();
------解决方案--------------------
DateTime dt = new DateTime(year, month, day);
dt.AddDays(-1); //周四
Console.WriteLine(dt.ToString("dd-MM-yy"));
------解决方案--------------------
private string[] Get7days(DateTime d) { string[] str = new string[7]; for (int i = 0; i < 7; i++) { DateTime dt = d.AddDays(-1 * i); str[6 - i] = dt.DayOfWeek.ToString(); } return str; }