⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 signin.aspx.cs

📁 asp.net 2.0的教务管理软件源码
💻 CS
字号:
using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
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;

//该源码下载自www.51aspx.com(51aspx.com)
public partial class Signin : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //如果用户已登录则注销登录
        btnForgotPassword.Attributes.Add("onclick", "alert('我也没办法!试试51aspx');return false;");
        if (!IsPostBack && CommOp.ToInt(Session["LoginID"]) != 0)
        {
            Session["LoginID"] = "";
        }
    }

    protected void btnLogin_Click(object sender, EventArgs e)
    {
        string user;
        ErrMsg.Text = "";
        string pass;
        int id;
        user = txtUser.Text.Trim();
        pass = Md5Convert.MD5(txtPass.Text);
 //       Response.Write(pass);

        List<SqlParameter> sp = new List<SqlParameter>();
        sp.Add(new SqlParameter("@LoginInfo", user));
        sp.Add(new SqlParameter("@PassWord", pass));

        id = DBExec.ExecGetInt("p_Login", sp);

        if (id == 0)
        {
            ErrMsg.Text += "用户名或密码不符.<br />";
            return;
        }

        Session["LoginID"] = id;
        Response.Redirect("~/");
    }
}

⌨️ 快捷键说明

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