Web/index.aspx.cs

(开头部分) 1KB

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

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FC.Common;
using System.Data;

public partial class index : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["sname"] != null)
            {
                Label1.Text = Session["sname"].ToString();
            }
            bind();
        }
    }

    protected void bind()
    {
        FC.BLL.courses bll = new FC.BLL.courses();
        Repeater1.DataSource = bll.GetData("top 5 * ", " 1=1 order by courID desc");
        Repeater1.DataBind();
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        if (this.TextBox1.Text.Length == 0)
        {
            Msg.Show("用户名不能为空");
            return;
        }
        if (this.TextBox2.Text.Length == 0)
        {
            Msg.Show("密码不能为空");
            return;
        }

        FC.BLL.students bll = new FC.BLL.students();
        string Pass = this.TextBox2.Text.Replace("'", "''");
        DataSet ds = bll.GetData("*", " sno='" + this.TextBox1.Text.Replace("'", "''") + "' and pwd='" + Pass + "'");
        if (ds.Tables[0].Rows.Count > 0)
        {
            DataRow dr = ds.Tables[0].Rows[0];
            Session["sno"] = dr["sno"].ToString();
            Session["sname"] = dr["sname"].ToString();
            Response.Redirect("person/Default.aspx");
        }
        else
        {
            Msg.Show("您输入的用户名或密码不正确");
            return;
        }
    }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
后面还有 4 行代码,购买后查看完整代码

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

AI 解读

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

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