login.aspx.cs

(开头部分) 2KB

这里只显示每个文件的开头 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.SqlClient;


/// <summary>
/// 用户登录
/// </summary>
public partial class login : PageBase
{

    
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {   
            Random validateN = new Random();
            this.Label1.Text = validateN.Next(9).ToString() + validateN.Next(9).ToString() + validateN.Next(9).ToString() + validateN.Next(9).ToString();
        }
    }
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        string username = Request["username"];
        string userpwd = Request["userpwd"];
        ZF.yhxx model = new ZF.yhxx();
        if (string.IsNullOrEmpty(username))
        {
            Response.Write("<script>alert('用户名错误!');history.back()</script>");
            return;
        }
        if (string.IsNullOrEmpty(userpwd))
        {
            Response.Write("<script>alert('密码错误!');history.back()</script>");
            return;
        }
        if (this.ValidateNumber.Text != this.Label1.Text)
        {
            Response.Write("<script>alert('验证码错误');history.back()</script>");
            return;
        }
        SqlConnection strcon = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["strcon"]);
        strcon.Open();
        SqlCommand scd = new SqlCommand("select count(*) as ff from yhxx where zh='"+username+"' and pwd='"+userpwd+"'",strcon);
        int count = Convert.ToInt32(scd.ExecuteScalar());
        if (count > 0)
        {
            Session["username"] = username;
            Session["usertype"] = this.ddlUserType.SelectedItem.Text;
            Response.Redirect("default.aspx");
        }
        else
        {
后面还有 5 行代码,购买后查看完整代码

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

AI 解读 AI

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

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