Hidistro.UI.Web/Config.cs

(完整代码) 1KB

using Newtonsoft.Json.Linq;
using System;
using System.IO;
using System.Linq;
using System.Web;

public static class Config
{
    private static JObject _Items;
    private static bool noCache = true;

    private static JObject BuildItems()
    {
        return JObject.Parse(File.ReadAllText(HttpContext.Current.Server.MapPath("/hieditor/ueditor/net/config.json")));
    }

    public static int GetInt(string key)
    {
        return GetValue<int>(key);
    }

    public static string GetString(string key)
    {
        return GetValue<string>(key);
    }

    public static string[] GetStringList(string key)
    {
        return (from x in Items[key] select x.Value<string>()).ToArray<string>();
    }

    public static T GetValue<T>(string key)
    {
        return Items[key].Value<T>();
    }

    public static JObject Items
    {
        get
        {
            if (noCache || (_Items == null))
            {
                _Items = BuildItems();
            }
            return _Items;
        }
    }
}

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

AI 解读 AI

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

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