BBSWeb/Services/Bbs/S_TopicsAdd.ashx

(开头部分) 15KB

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

<%@ WebHandler Language="C#" Class="S_TopicsAdd" %>
using System;
using System.Web;
using WebApp;
using System.IO;
using System.Globalization;
using LitJson;
using System.Web.SessionState;
using System.Data;
using BaseConfig;
using BBS.Model;
using BBS.BLL;

public class S_TopicsAdd : IHttpHandler, IRequiresSessionState
{
    public void ProcessRequest(HttpContext context)
    {
        if (HttpContext.Current.Session[SessionKey.USER] == null)
        {
            context.Response.Write("{\"status\" : \"success\",\"msg\": \"操作失败!\"}");
            return;
        }

        int TOPICID = StringUtil.GetIntValue(HttpContext.Current.Request["Topicd"]);
        if (TOPICID > 0)
        {
            //判断权限
            X_UserInfo mUser = (X_UserInfo)HttpContext.Current.Session[SessionKey.USER];
            BBS.BLL.F_Topics bllTopic = new BBS.BLL.F_Topics();
            BBS.Model.F_Topics mTopic = bllTopic.GetModel(TOPICID);
            if (mTopic.userId != mUser.UserId)
            {
                context.Response.Write("{\"status\" : \"success\",\"msg\": \"操作失败!\"}");
                return;
            }
        }

        X_UserInfo u = (X_UserInfo)HttpContext.Current.Session[SessionKey.USER];
        string ip = HttpContext.Current.Request.UserHostAddress;
        string title = StringUtil.CutBadSqlInfo(StringUtil.GetNullToString(HttpContext.Current.Request["title"]));  //标题
        title = HttpContext.Current.Server.HtmlEncode(title);
        string contents = StringUtil.GetNullToString(HttpContext.Current.Request["contents"]);
        contents = contents.Replace("+", "$$$$$");  //详细内容
        contents = HttpContext.Current.Server.HtmlEncode(HttpContext.Current.Server.UrlDecode(StringUtil.GetNullToString(contents)));  //内容
        contents = contents.Replace("$$$$$", "+");

        contents = contents.Replace("$$$$$", "+");
        int Forum = Convert.ToInt32(HttpContext.Current.Server.UrlDecode(StringUtil.GetNullToString(HttpContext.Current.Request["Forum"]))); //分论坛
        int SubBbsId = Convert.ToInt32(HttpContext.Current.Server.UrlDecode(StringUtil.GetNullToString(HttpContext.Current.Request["SubBbs"]))); //项目
        int Bbs = Convert.ToInt32(HttpContext.Current.Server.UrlDecode(StringUtil.GetNullToString(HttpContext.Current.Request["Bbs"]))); //版块

        string filepath = HttpContext.Current.Server.UrlDecode(StringUtil.GetNullToString(HttpContext.Current.Request["filepath"])); //路径
        string verifyUsers = HttpContext.Current.Server.UrlDecode(StringUtil.GetNullToString(HttpContext.Current.Request["verifyUser"]));  //审核者
        string replyUsers = HttpContext.Current.Server.UrlDecode(StringUtil.GetNullToString(HttpContext.Current.Request["replyUsers"])); //回复者
        string replyUserIds = HttpContext.Current.Server.UrlDecode(StringUtil.GetNullToString(HttpContext.Current.Request["replyUserIds"]));  //回复者id
        string verityid = HttpContext.Current.Server.UrlDecode(StringUtil.GetNullToString(HttpContext.Current.Request["verifyUserId"])); //审核者id
        context.Response.Clear();
        context.Response.ContentType = "text/html";//这里一定要html
        HttpFileCollection postedFile = context.Request.Files;
        string sNewFileName = "";
后面还有 276 行代码,购买后查看完整代码

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

AI 解读 AI

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

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