App_Code/login.cs

(完整代码) 1KB

using System;
using System.Data;
using System.Configuration;
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)

/// <summary>
/// login 的摘要说明
/// </summary>
public class login
{
	public login()
	{
		//
		// TODO: 在此处添加构造函数逻辑
		//5_1_a_s_p_x.c_o_m

	}
    public static void lo(string usn, string pwd)
    {
        string sql = "select id from login where admin='" + usn + "' and password='" + pwd + "'";
        DataTable dt= access.GDS(sql).Tables[0];
        if (dt.Rows.Count > 0)
        {
            System.Web.HttpContext.Current.Session["uid"] = dt.Rows[0]["id"];
            System.Web.HttpContext.Current.Response.Write("<script>location.href='add_news.aspx'; alert('登陆成功!');</script>");
        }
        else
        {
            System.Web.HttpContext.Current.Response.Write("<script>alert('登陆成功!');</script>");
        }

    }
    //判断用户是否登陆
    public static void pd()
    {
        if (System.Web.HttpContext.Current.Session["admin"] == null)
        {
            System.Web.HttpContext.Current.Response.Write("<script>alert('对不起,你还没有登陆!'); this.location.href='login.aspx';</script>");
        }
    }
}

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

AI 解读 AI

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

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