Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/260.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
反序列化json c#获取变量的值_C#_Json_Windows Phone - Fatal编程技术网

反序列化json c#获取变量的值

反序列化json c#获取变量的值,c#,json,windows-phone,C#,Json,Windows Phone,我使用反序列化JSON。我有下一个答案 string answer = getjsonnanswer(url); JObject a = JObject.Parse(answer); 我如何引用a,它在JSON应答中得到615——它的变量值,但它没有名字 { "response": [615, { "body": "Привет) как жизнь?", "title": "Re(2): ...", "date":

我使用反序列化JSON。我有下一个答案

string answer = getjsonnanswer(url);
JObject a = JObject.Parse(answer);
我如何引用
a
,它在JSON应答中得到615——它的变量值,但它没有名字

{
    "response": [615, 
    {
        "body": "Привет) как жизнь?",
        "title": "Re(2): ...",     
        "date": 1268238828,
        "uid": 10024748,
        "mid": 11056,
        "read_state": 0,
        "out":0
    }, 
    {
        "body": "Жду :)",
        "title": "Re(23): ...",
        "date": 1268238448, 
        "uid": 27495120, 
        "mid": 11045,
        "read_state": 1,
        "out":1
    }]
}

只需添加索引器即可从“response”数组中获取第一项:


只需添加索引器即可从“response”数组中获取第一项:


那么如何找到值为615的对象呢?你能给我一个精确的jsonstring吗?@anant Dabii{“response:[615,{“body:”Пжжжзззззззззз?”,“title:”Re(2):“,“date”:1268238828,“uid:”100247448,“mid”:11056,“read state:”0,“out:”,“body:”,“body:”,“read state:”,“read state:”12682384445,“,“read state:”:1,“out”:1}]}以及如何找到值为615的对象?你能给我一个确切的jsonstring吗?@anant Dabii{“response”:[615,{“body”:“Пажжзз?”,“title”:“Re(2):“,“date”:1268238828,“uid”:10024747448,“mid”:11056,“read u state”:0,“out”:0,{“body”:“title”:“Re(23):“date”,“date”:12682388238828”,uid:“mid”;“uid”:1269544120”:11045,“读取状态”:1,“输出”:1}]}
    JObject a = JObject.Parse(answer);


JsonObject a = new JsonObject(answer);
JsonArray ss = (JsonArray)a["response"];
var result = ss[0];
JObject a = JObject.Parse(answer);

var val = a["response"][0];