WebApplication/Ajax/register.ashx.cs

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

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

namespace WebApplication.Ajax
{
    /// <summary>
    /// register 的摘要说明
    /// </summary>
    public class register : IHttpHandler,IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain"; 
            if (context.Request["nickname"] != null && context.Request["username"] != null && context.Request["password"] != null && context.Request["pic"] != null)
            {
                Hashtable ht = new Hashtable();
                ht.Add("Title", context.Request["username"].ToString());
                ht.Add("PassWord", context.Request["password"].ToString());
                ht.Add("NickName", context.Request["nickname"].ToString());
                ht.Add("Pic", context.Request["pic"].ToString());
               
                int infoid = new BLL.Models.GZXX_Model().AddContent("GZXX_U_UserTable", ht);
                if (infoid > 0)
                {
                    context.Session["WebLoginName"] = context.Request["username"].ToString();
                    context.Session["WebPic"] = context.Request["pic"].ToString();
                    context.Session["WebRealName"] = context.Request["nickname"].ToString();
                    context.Session["WebInfoID"] = infoid;
                    context.Response.Write("注册成功!");
                }
                else
                {
                    context.Response.Write("注册失败!");
                }
            }
            else
            {
                context.Response.Write("参数错误!");
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}

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

AI 解读

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

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