Web/Tools/LoginHandler.ashx.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;
using System.Web;

namespace MyLogin.Ajax
{
    /// <summary>
    /// Summary description for LoginHandler
    /// </summary>
    public class LoginHandler : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            string username = context.Request["user"].ToString();
            string password = context.Request["password"].ToString();
            //context.Response.Write(password);如果使用加密,则写入数据库要加密后的字段,然后登陆的时候就用加密后的字符串匹配
            //此处连接数据库查看是否有此用户,此处为了方便起见,直接判断
            if (username == "admin")
            {
                context.Response.Write("1");
                //context.Response.Write("success");
                //存储session
            }
            else
            {
                context.Response.Write("1");
                //context.Response.Write("fail");
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }

    }
}

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

AI 解读 AI

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

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