日期:2014-05-17 浏览次数:20483 次
private DateTime GetDate(DayOfWeek dw, DateTime jcTime) { if ((jcTime.DayOfWeek & dw) != 0) { return jcTime; } for (int i = 1; i < 7; i++) { DateTime time = jcTime.AddDays(i); if ((time.DayOfWeek & dw) != 0) { return time; } } return jcTime; } protected void Page_Load(object sender, EventArgs e) { DateTime today = DateTime.Now; DayOfWeek dw; switch (m_GameType) { case 1://双色球 dw = DayOfWeek.Tuesday | DayOfWeek.Thursday | DayOfWeek.Sunday; timeStr = ConvertToString(GetKJDate(dw, DateTime.Now)) + " 19:30:00"; break; case 2://七乐彩 dw = DayOfWeek.Monday | DayOfWeek.Wednesday | DayOfWeek.Friday; timeStr = ConvertToString(GetKJDate(dw, DateTime.Now)) + " 19:30:00"; break; case 3://3D timeStr = ConvertToString(today) + " 19:30:00"; break; } }