protected void Timer1_Tick(object sender, EventArgs e)
{
int hour;
int minute;
int second;
int examTime = 20;
if (Session["examtime"] != null)
{
examTime = Convert.ToInt32(Session["examtime"]);
}
// 如果还有剩余时间,就显示剩余的分钟和秒数
if (examTime > 0)
{
examTime--;
Session["examtime"] = examTime;
hour = examTime / 3600;
minute = (examTime - hour * 3600) / 60;
second = examTime % 60;
lblTimer.Text = string.Format("{0:00}:{1:00}:{2:00}", hour, minute, second);
}
}