您好,我这里有一个json。在我的下面的代码中它是html。我的问题是我成为了这个错误:发生了类型为“System.NullReferenceException”的异常错误。我还调试了代码“html”有json数据,但在下一行的内容是null。
"{\"data\":[{\"q_id\":\"1\",\"q_text\":\"Ich read technical.\"},{\"q_id\":\"2\",\"q_text\":\"I have a good appetit.\"},{\"q_id\":\"3\",\"q_text\":\"I wake up early in the morning.\"}
这是我的代码
var g = new System.Web.Script.Serialization.JavaScriptSerializer().DeserializeObject(html) as Dictionary<string, object>;
var h = g["data"] as Dictionary<string, object>;
lbfield.Content = h["q_text"].ToString();