Hidistro.UI.Web/Admin/promotion/ConfigHandler.cs

(完整代码) 1KB

namespace Hidistro.UI.Web.Admin.promotion
{
    using Hidistro.Core;
    using Hidistro.Core.Entities;
    using System;
    using System.Web;

    public class ConfigHandler : IHttpHandler
    {
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            try
            {
                string str = context.Request["type"].ToString();
                SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
                switch (str)
                {
                    case "0":
                    {
                        bool flag = bool.Parse(context.Request["enable"].ToString());
                        masterSettings.PonitToCash_Enable = flag;
                        break;
                    }
                    case "1":
                    {
                        bool flag2 = bool.Parse(context.Request["enable"].ToString());
                        masterSettings.ShareAct_Enable = flag2;
                        break;
                    }
                }
                SettingsManager.Save(masterSettings);
                context.Response.Write("保存成功");
            }
            catch (Exception exception)
            {
                context.Response.Write("保存失败!(" + exception.Message + ")");
            }
        }

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

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

AI 解读 AI

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

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