C#高职计算机导论考试系统设计与实现(19)_毕业论文

毕业论文移动版

毕业论文 > 计算机论文 >

C#高职计算机导论考试系统设计与实现(19)


                }
                catch (Exception ex)
                {
                    message = "操作数据库出错!";
                    Console.WriteLine(ex.Message);
                    return false;
                }
                finally
                {
                    // 关闭数据库连接
                    DBHelper.connection.Close();
                }
            }
            message = "请选择教师或学生类型登陆";
            return false;
        }
2) 倒计时模块实现源代码
public static int totalSeconds = 2700;
…………………………
private void AnswerQuestionForm_Load(object sender, EventArgs e)
        {
            // 打开计时器
            tmrCostTime.Start();
……………………….
private void tmrCostTime_Tick(object sender, EventArgs e)
        {
            int minute;                        // 当前的分钟
            int second;                        // 秒
            if (QuizHelper.remainSeconds > 0)  // 如果还剩时间
            {
                QuizHelper.remainSeconds--;
                minute = QuizHelper.remainSeconds / 60;
                second = QuizHelper.remainSeconds % 60;
                txtTimer.Text = string.Format("{0:00}:{1:00}",
                                      minute, second); // 控制显示格式
            } (责任编辑:qin)