日期:2014-05-17 浏览次数:21096 次
private void timer1_Tick(object sender, EventArgs e)
{
if (DateTime.Now.Hour >= 19 && DateTime.Now.Hour < 20)
{
DateTime dt = DateTime.Now;
DateTime timeCountDown = new DateTime(dt.Year, dt.Month, dt.Day, 20, 0, 0);
this.label1.Text = string.Format("{0:D2}:{1:D2}:{2:D2}",
(timeCountDown - DateTime.Now).Hours,
(timeCountDown - DateTime.Now).Minutes,
(timeCountDown - DateTime.Now).Seconds);
}
else
{
this.label1.Text = "";
}
}