Web/Text/SubmitContent.ashx.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Web.Text
{
    /// <summary>
    /// SubmitContent 的摘要说明
    /// 提交评论
    /// </summary>
    public class SubmitContent : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            Model.WebSet SiteConfig = new BLL.WebSet().loadConfig(Common.Utils.GetXmlMapPath("Configpath"));
            string username = context.Request["user"].ToString();
            string content = context.Request["content"].ToString();
            string goodid = context.Request["goodid"].ToString();

            BLL.AllAdvisory bll = new BLL.AllAdvisory();
            Model.AllAdvisory model = new Model.AllAdvisory();
            model.KindId = 1;
            model.ParentId = int.Parse(goodid);
            model.UserName = username;
            model.Content = content;
            model.IsLock = SiteConfig.IsCheckComment;
            model.AddTime = DateTime.Now;
            if (bll.Add(model) > 0)
            {
                context.Response.Write(1);
            }
            else
            {
                context.Response.Write(0);
            }
        }

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

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

AI 解读 AI

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

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