private Hashtable GetWeekdays()
{
Hashtable htweekdays = new Hashtable();
DateTime dtime = new DateTime(ThisYear, 1, 1);
if (Convert.ToInt32(dtime.DayOfWeek) != 7)
{
dtime = dtime.AddDays(7 - Convert.ToInt32(dtime.DayOfWeek) - 1);
//string str = dtime.Month + "月" + dtime.Day + "日";
string str = dtime.ToString("yyyyMMdd");
htweekdays.Add(str, 1);
dtime = dtime.AddDays(1);
//str = dtime.Month + "月" + dtime.Day + "日";
str = dtime.ToString("yyyyMMdd");
htweekdays.Add(str, 1);
}
while (dtime.AddDays(6).Year <= ThisYear)
{
dtime = dtime.AddDays(6);
//string str = dtime.Month + "月" + dtime.Day + "日";
string str = dtime.ToString("yyyyMMdd");
htweekdays.Add(str, 1);
dtime = dtime.AddDays(1);
//str = dtime.Month + "月" + dtime.Day + "日";
str = dtime.ToString("yyyyMMdd");
htweekdays.Add(str, 1);
}
return htweekdays;
}
{
Hashtable htweekdays = new Hashtable();
DateTime dtime = new DateTime(ThisYear, 1, 1);
if (Convert.ToInt32(dtime.DayOfWeek) != 7)
{
dtime = dtime.AddDays(7 - Convert.ToInt32(dtime.DayOfWeek) - 1);
//string str = dtime.Month + "月" + dtime.Day + "日";
string str = dtime.ToString("yyyyMMdd");
htweekdays.Add(str, 1);
dtime = dtime.AddDays(1);
//str = dtime.Month + "月" + dtime.Day + "日";
str = dtime.ToString("yyyyMMdd");
htweekdays.Add(str, 1);
}
while (dtime.AddDays(6).Year <= ThisYear)
{
dtime = dtime.AddDays(6);
//string str = dtime.Month + "月" + dtime.Day + "日";
string str = dtime.ToString("yyyyMMdd");
htweekdays.Add(str, 1);
dtime = dtime.AddDays(1);
//str = dtime.Month + "月" + dtime.Day + "日";
str = dtime.ToString("yyyyMMdd");
htweekdays.Add(str, 1);
}
return htweekdays;
}