如何从此对象中获取"v"值 + JSON.Net


如何使用

JSON.Net 从数据["v"]中获取值

{
    "event": "ConnectTheDots",
    "data": "{ "s":"wthr",
           "u":"F",
           "l":"Jaipur - The Pink City",
           "m":"Temperature",
           "o":"Nagarro",
           "v": 3,
           "d":"T" 
         }
    "published_at": "2016-06-08T11:48:32.772Z",
    "coreid": "2b0046000347343138333038",
    "guid": "2b0046000347343138333038",
    "timecreated": "2016-06-08T11:48:32.772Z",
    "location": "",
    "displayname": "",
    "organization": "",
    "value": "",
    "measurename": "",
    "unitofmeasure": "",
    "subject": ""
}

将其反序列化为动态对象。请参阅使用 Json.net 将 json 对象反序列化为动态对象

dynamic parsed = JObject.Parse(json);
var v = parsed.data.v;  // 3

相关内容

  • 没有找到相关文章

最新更新