开发者

How to get key value

开发者 https://www.devze.com 2022-12-11 12:35 出处:网络
My sample JSON string is as below: {\"8776337\":{\"text\":\"Test Message\",\"status\":\"d\",\"created_time\":\"1244475327\",\"reply开发者_JAVA百科_number\":\"447624800500\",\"completed_time\":\"12444

My sample JSON string is as below:

{"8776337":{"text":"Test Message","status":"d","created_time":"1244475327","reply开发者_JAVA百科_number":"447624800500","completed_time":"1244475373","credits_cost":"0.4"}}

"8776337" is dynamic key returned by some APIs. I want to get this key value using LINQ to JSON query.

How can I get this key value using LINQ to JSON?


I know how to get this value with javascript:

function test()
{
var p = {"8776337":{"text":"Test Message","status":"d","created_time":"1244475327","reply_number":"447624800500","completed_time":"1244475373","credits_cost":"0.4"}};
  for (var key in p) {
      if (p.hasOwnProperty(key)) {
        alert(key);
      }
    }
}

then it would be easy to send it to the server side!

0

精彩评论

暂无评论...
验证码 换一张
取 消