2011-08-17 69 views
0

我正在使用Json.Net.My的問題是:我如何解析Json下ASP.Net?提前。如何在ASP.Net下解析Json?

[ 
    { 
    "1":[ 
    "Fax1", 
    "Fax2", 
    "Fax3" 
    ] 
    }, 
    { 
    "2":[ 
    "SES1", 
    "SES2", 
    "SES3" 
    ] 
    }, 
    { 
    "3":[ 
    "IVR1", 
    "IVR2", 
    "IVR3" 
    ] 
    } 
    ] 

回答

1

可在反序列化此作爲字典的數組:

Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string,string[]>[]>(jsonData); 

或可替代的方式List代替數組:

Newtonsoft.Json.JsonConvert.DeserializeObject<List<Dictionary<string,List<string>>>>(jsonData);