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", ....
}
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", ....
}
you can use
JavaScriptSerializer for this.
List<Class> list = new JavaScriptSerializer().Deserialize<List<Class>>(jsonString);
you need to use
using System.Web.Script.Serialization;
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