Default.aspx.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

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.OleDb;

public partial class _Default : System.Web.UI.Page
{
    CommDB mydb = new CommDB();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)            
            Label1.Text = mydb.RandomNum(4);
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string mysql;
        int i;
        string uname = "";
        if (TextBox3.Text.Trim() != Label1.Text.Trim()) //验证码输入错误
            Response.Write("<script>alert('你的验证码输入错误,请重输入!')</script>");
        else
        {
            // 下载于www.51aspx.com
            if (RadioButton1.Checked)   //学生登陆
            {
                mysql = "SELECT sname FROM student WHERE sno = '" + TextBox1.Text + "' AND spass = '" + TextBox2.Text + "'";
                i = mydb.Rownum(mysql, "student", ref uname);
                if (i > 0)              //合法用户
                {
                    Session["uno"] = TextBox1.Text.Trim();      //保存学号
                    Session["uname"] = uname;	                //保存姓名
                    Server.Transfer("~/studentmenu.aspx");
                }
                else    //非法用户
                    Response.Write("<script>alert('对不起,你输入的用户名或者密码错误,请查实!')</script>");
            }
            else if (RadioButton2.Checked)   //教师登陆
            {
                mysql = "SELECT tname FROM teacher WHERE tno = '" + TextBox1.Text + "' AND tpass = '" + TextBox2.Text + "'";
                i = mydb.Rownum(mysql, "teacher", ref uname);
                if (i > 0)              //合法用户
                {
                    Session["uno"] = TextBox1.Text.Trim();      //保存教师编号
                    Session["uname"] = uname;	                //保存姓名
                    Server.Transfer("~/teachermenu.aspx");
                }
                else    //非法用户
                    Response.Write("<script>alert('对不起,你输入的用户名或者密码错误,请查实!')</script>");
            }
            else if (RadioButton3.Checked)   //管理员登陆
            {
                mysql = "SELECT mname FROM manager WHERE mno = '" + TextBox1.Text + "' AND mpass = '" + TextBox2.Text + "'";
                i = mydb.Rownum(mysql, "manager", ref uname);
后面还有 18 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。