开发者

How do I parse below Json in ASP.Net?

开发者 https://www.devze.com 2023-03-28 12:52 出处:网络
I\'m using Json.Net.My question is:How do I parse below Json in ASP.Net?Thanks inadvance. [ { \"1\":[ \"Fax1\",

I'm using Json.Net.My question is:How do I parse below Json in ASP.Net?Thanks in advance.

  [
  {
  "1":[
     "Fax1",
     "Fax2",
     "Fax3"
  ]
  },
  {
  "2":[
     "SES1",
     "SES2",
     "SES3"
  ]
  },
  {
  "3":开发者_运维问答[
     "IVR1",
     "IVR2",
     "IVR3"
   ]
  }
  ]


You may deserialize this as an array of Dictionary:

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

or alternative as List instead of arrays:

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

精彩评论

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