基本信息
源码名称:asp.net+acesse数据库,轻量级网站及后台管理
源码大小:1.53M
文件格式:.zip
开发语言:C#
更新时间:2019-03-07
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559

本次赞助数额为: 12 元 
   源码介绍
账号:xuligang 密码:xuligang




using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Data.OleDb;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using DbAccess;
using Encrypt;

public partial class manage_login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        string admin=Request.Params["admin"];
        string pwd=Request.Params["pwd"];
        Label1.Text = "";
        
        
        if (Session["login_error_times"] != null && (int)Session["login_error_times"] > 5)
        {
            Label1.Text = "错误登录次数超过5次,请20分钟后重新登陆<script type='text/javascript'>document.getElementById('xlog').style.display='none';</script>";
            return;
        }

        if (admin == null || pwd == null)
            return;

        if (admin.Length > 0 && admin.Length < 20 && pwd.Length > 0 && pwd.Length < 20 && admin.IndexOf(" ") == -1 && pwd.IndexOf(" ") == -1 && admin.IndexOf("'") == -1)
        {

            pwd = MD5.GetMD5(pwd);

            string sql = "select * from admin where username='"   admin   "' and pwdmd5='"   pwd   "'";

            AccessNet dblink = new AccessNet();
            dblink.openConnection();
            OleDbDataReader rs = dblink.executeQuery(sql);

            if (rs.Read())
            {
                Session.Add("xname", pwd);
                Session.Add("xxname", rs["pwdmd5"].ToString());

                Session.Add("user", rs["username"].ToString());
				//关闭连接
				rs.Close();
				dblink.close();
                Response.Redirect("index.aspx");
            }
            else
            {	
                //关闭连接
				rs.Close();
				dblink.close();                
                Label1.Text = "用户名或密码错误!";
                if (Session["login_error_times"] != null)
                    Session["login_error_times"] = (int)Session["login_error_times"]   1;
                else Session.Add("login_error_times", 1);
            }

        }

       else
       {
           Label1.Text = "用户名或密码错误!";
           if (Session["login_error_times"] != null)
                Session["login_error_times"] = (int)Session["login_error_times"]   1;
           else Session.Add("login_error_times", 1);
       }        
    }
}