Web/Tools/NewsItemsAction.ashx.cs

(开头部分) 3KB

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

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.SessionState;
using System.Data;
using Common;
namespace Web.Tools
{
    /// <summary>
    /// $codebehindclassname$ 的摘要说明
    /// </summary>
    public class NewsItemsAction : IHttpHandler, IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            string action = context.Request.Params["action"];
            //context.Response.Write(password);如果使用加密,则写入数据库要加密后的字段,然后登陆的时候就用加密后的字符串匹配
            //此处连接数据库查看是否有此用户,此处为了方便起见,直接判断
            BLL.AllReviews bll = new BLL.AllReviews();
            Model.AllReviews model = new Model.AllReviews();
            if (action == "send")
            {
                Model.WebSet webset = new BLL.WebSet().loadConfig(Common.Utils.GetXmlMapPath("Configpath"));
                string content = context.Request["content"].ToString();
                string NewsId = context.Request["sid"].ToString();
                string typeid = context.Request["typeid"].ToString();
                string mid = context.Request["mid"].ToString();
                string member = context.Request["member"].ToString();
                string pwd = context.Request["pwd"].ToString();
                model.KindId = int.Parse(typeid);
                model.ParentId = int.Parse(NewsId);
                model.Content = Utils.ToHtml(content);
                model.IsLock = webset.IsCheckComment; //评论是否需要审核
                string UserPwd = Common.DESEncrypt.Encrypt(pwd);
                BLL.Member hybll = new BLL.Member();
                if (mid == "0")
                {
                    if (hybll.chkAdminLogin(member, UserPwd))
                    {
                        Model.Member hymodel = new Model.Member();
                        hymodel = hybll.GetModel(member);
                        model.MemberId =hymodel.Id;
                        model.UserName = member;
                        if (bll.Add(model) != 0)
                        {
                            context.Response.Write("{\"num\":\"1\",\"message\":\"发表评论成功!\"}");
                        }
                        else
                        {
                            context.Response.Write("{\"num\":\"2\",\"message\":\"发表评论失败啦!\"}");
                        }
                    }
                    else
                    {
                        context.Response.Write("{\"num\":\"3\",\"message\":\"用户名或用户密码不正确!\"}");
                    }
                }
                else
                {
后面还有 24 行代码,购买后查看完整代码

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

AI 解读 AI

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

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