{
\"jsonstring\": [
{
\"id\":\"01\",
\"language\": \"Java\",
\"edition\": \"third\",
\"author\": \"Herbert Schildt\"
},
{
\"id\":
In .NET you can use JavaScriptSerializer. First you will need to create a class that has the same structure as the json string.
Example:
{
"Id":"07",
"Language": "C++"
}
public class CSharpObject
{
int Id {get; set;}
string Language {get; set;}
}
string json = HttpUtility.HtmlDecode(jsonString);
JavaScriptSerializer json_serializer = new JavaScriptSerializer();
CSharpObject csharpObject = (CSharpObject)json_serializer.Deserialize<CSharpObject>(json);
Use NewtonSoft.NET:
var obj = JsonConvert.DeserializeObject(json);
Maybe make a corresponding class for using generics too:
public class ClassName {
public string id { get; set; }
public string language { get; set; }
public string edition { get; set; }
public string author { get; set; }
}
then you can do:
List<ClassName> list = JsonConvert.DeserializeObject<List<ClassName>>(json);