示例#1
0
        string IReadContext.Read(string path)
        {
            string endPath;

            if (path.Contains("/") == false)
            {
                endPath = path;
            }
            else
            {
                endPath = path.Split('/')[path.Split('/').Length - 1];
            }
            IReadContext      red   = ToEndNode(this.context, path);
            ReadContextByJson rJson = (ReadContextByJson)red;
            JObject           obj   = (JObject)Newtonsoft.Json.JsonConvert.DeserializeObject(rJson.context);

            if (obj.GetValue(endPath) == null)
            {
                return("");
            }
            else
            {
                return(obj.GetValue(endPath).ToString());
            }
        }
示例#2
0
 public WebHelper(string json)
 {
     ReadContext = new ReadWriteContext.ReadContextByJson(json);
     kv          = ReadContext.ToDictionary();
 }