0

I have json few json file with text localization data. i want to convert this json file to dictionary. I couldnt use json.net or other frameworks. How can i do this?

{ main_menu_ng:"new game", main_menu_lg:"load game", ....

}

everscope
  • 39
  • 6

2 Answers2

0

you can use

JavaScriptSerializer for this.

List<Class> list = new JavaScriptSerializer().Deserialize<List<Class>>(jsonString);

you need to use

using System.Web.Script.Serialization;
Kevin Shah
  • 1,589
  • 1
  • 13
  • 20
0

I think you can use JsonConvert.DeserializeObject<> for that:

var json = File.ReadAllText(yourFileName);
yourDictionary = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);

as answered here: https://stackoverflow.com/a/39539454/10120770