Views/UserCenter/UserPassword.ashx

(开头部分) 5KB

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

<%@ WebHandler Language="C#" Class="UserPassword" %>

using System;
using System.Web;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using MicroDBHelper;
using MicroPublicHelper;
using MicroUserHelper;
using Newtonsoft.Json.Linq;
using MicroAuthHelper;

public class UserPassword : IHttpHandler, System.Web.SessionState.IRequiresSessionState
{

    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "text/plain";
        MicroAuth.CheckLogin();

        string flag = MicroPublic.GetMsg("ModifyFailed"),
                    Action = context.Server.UrlDecode(context.Request.Form["action"]),
                    MID = context.Server.UrlDecode(context.Request.Form["mid"]),
                    Fields = context.Server.UrlDecode(context.Request.Form["fields"]);


        if (Action == "modify" && !string.IsNullOrEmpty(Fields))
            flag = ModifyUserPassword(Fields);


        context.Response.Write(flag);
    }

    private string ModifyUserPassword(string Fields)
    {
        string flag = string.Empty;
        try
        {

            string UserPassword = string.Empty; string NewUserPassword = string.Empty;

            int UID = ((MicroUserInfo)HttpContext.Current.Session["UserInfo"]).UID;

            dynamic json = JToken.Parse(Fields) as dynamic;

            UserPassword = json["txtUserPassword"];
            if (!string.IsNullOrEmpty(UserPassword))
                UserPassword = UserPassword.toStringTrim();

            NewUserPassword = json["txtNewUserPassword"];
            if (!string.IsNullOrEmpty(NewUserPassword))
                NewUserPassword = NewUserPassword.toStringTrim();

            if (!string.IsNullOrEmpty(NewUserPassword))
            {
                string _sql = "select UserName,UserPassword from UserInfo where UID=@UID ";
                SqlParameter[] _sp = { new SqlParameter("@UID", SqlDbType.Int) };

                _sp[0].Value = UID;
后面还有 77 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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