Jobject 使用

 obj2 = JObject.Parse(result.Html);

JArray _Jarr = _obj["data"]["siteList"].Value<JArray>();
if (_Jarr == null)
return;
//bool isym= _Jarr.Any(p => p["url"].Value<string>().Contains("gangzan.com"));

   //bool hasErr = _obj.Properties().Any(p => p.Name == "err");//或是这样
                //var names = from domains in _obj["data"]["siteList"].Children()
                //            select (string)domains["url"];
                ////foreach (var name in names)
                ////{

                ////}
                //return names;
                //

                
                //IEnumerable<JProperty> properties = _obj.Properties();
                //foreach (JProperty item in properties)
                //{

                //    Console.WriteLine(item.Name + ":" + item.Value);
                //}
                

                //MessageBox.Show(_obj["data"]["siteList"][0].Value<string>());

//保留数据
//JEnumerable<JToken> ss = _Jarr[0][“tkSpecialCampaignIdRateMap”].Children();
//foreach (var items in ss)
// DPlan.Add(((JProperty)(items)).Name, float.Parse(((JProperty)(items)).Value.ToString()));
var dicSort = from objDic in DPlan orderby objDic.Value descending select objDic;

Published by

风君子

独自遨游何稽首 揭天掀地慰生平

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注