zhuce.aspx.cs

来自「考试系统,包括组试卷,用户管理,角色分配 实现在线考试」· CS 代码 · 共 45 行

CS
45
字号
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 zhuce : System.Web.UI.Page
{
    Datacon dataconn = new Datacon();
    protected void Page_Load(object sender, EventArgs e)
    {
        dataconn.ecDropDownList(ddlProfession, "select * from tb_Profession", "Name", "ID");
    }
    protected void Button3_Click(object sender, EventArgs e)
    {
        Response.Redirect("Default.aspx");
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        dataconn.eccom("insert into tb_Student"
            +"(ID,Name,PWD,question,answer,Sex,profession)"
            +"values('" + this.txtStuID.Text + "','" + this.txtStuName.Text + "','" 
            + this.txtStuPwd.Text + "','" + this.txtQuePwd.Text + "','" 
            + this.txtAnsPwd.Text + "','" + this.ddlSex.Text + "','" 
            + Request["DropDownList2"] + "')");
        Response.Write("<script lanuage=javascript>alert('您已经注册成功,欢迎使用该系统!');location='javascript:history.go(-1)'</script>");
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        txtStuID.Text = "";
        txtStuName.Text = "";
        txtStuPwd.Text = "";
        txtStuFPwd.Text = "";
        txtQuePwd.Text = "";
        txtAnsPwd.Text = "";
        txtStuID.Focus();
    }
}

⌨️ 快捷键说明

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