result.aspx.cs

来自「在线考试」· CS 代码 · 共 35 行

CS
35
字号
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class student_result : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string Rans = Session["Ans"].ToString();//正确答案
        int j = Convert.ToInt32(Request.QueryString["BInt"]);
        string Sans = Session["Sans"].ToString();
        int StuScore = 0;
        for (int i = 0; i < j; i++)
        {
            if (Rans.Substring(i, 1).Equals(Sans.Substring(i, 1)))
            {
                StuScore += 2;
            }
        }
        this.lblResult.Text = StuScore.ToString();
        this.lblkm.Text = Session["KM"].ToString();
        this.lblnum.Text = Session["ID"].ToString();
        this.lblname.Text = Session["name"].ToString();
        string strsql = "update tb_score set score='" + StuScore.ToString() + "' where StudentID='" + Session["ID"].ToString() + "' and LessonName='" + Session["KM"].ToString() + "'";
        BaseClass.OperateData(strsql);
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?