我的示例JSON字符串如下:
{"8776337":{"text":"Test Message","status":"d","created_time":"1244475327","reply_number":"447624800500","completed_time":"1244475373","credits_cost":"0.4"}}
“8776337”是某些API返回的动态密钥。我想使用LINQ to JSON查询来获取此键值。
如何使用LINQ to JSON获取此键值?
答案 0 :(得分:0)
我知道如何使用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);
}
}
}
然后将它发送到服务器端很容易!