Web/Tools/Comment_json.ashx.cs

(开头部分) 6KB

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

using System;
using System.Collections;
using System.Data;
using System.Web;
using System.Web.SessionState;
using Common;

namespace Web.Tools
{
    /// <summary>
    /// AJAX显示或提交评论
    /// </summary>
    public class Comment_json : IHttpHandler, IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            string action = context.Request.Params["action"];
            if (action == "add")
            {
                //取得站点配置信息
                Model.WebSet webset = new BLL.WebSet().loadConfig(Utils.GetXmlMapPath("Configpath"));

                int _kindId;
                int _parentId;
                string _code = context.Request.Form["txtCode"];
                string _username = context.Request.Form["txtUserName"];
                int _grade;
                string _content = context.Request.Form["txtContent"];

                //获得栏目ID
                if (!int.TryParse(context.Request.Params["kindId"] as string, out _kindId))
                {
                    context.Response.Write("{msg:0, msgbox:\"无法找到你所要评论的栏目!\"}");
                    return;
                }
                //获得信息ID
                if (!int.TryParse(context.Request.Params["parentId"] as string, out _parentId))
                {
                    context.Response.Write("{msg:0, msgbox:\"无法找到你所要评论的信息!\"}");
                    return;
                }
                //校检验证码
                if (string.IsNullOrEmpty(_code))
                {
                    context.Response.Write("{msg:0, msgbox:\"对不起,请输入验证码!\"}");
                    return;
                }
                if (context.Session["DtCode"] == null)
                {
                    context.Response.Write("{msg:0, msgbox:\"对不起,系统找不到生成的验证码!\"}");
                    return;
                }
                if (_code.ToLower() != (context.Session["DtCode"].ToString()).ToLower())
                {
                    context.Response.Write("{msg:0, msgbox:\"您输入的验证码与系统的不一致!\"}");
                    return;
                }

                //获得评价星级
后面还有 101 行代码,购买后查看完整代码

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

AI 解读 AI

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

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