75
rated 0 times
[
82]
[
7]
/ answers: 1 / hits: 42300
/ 11 Years ago, wed, september 11, 2013, 12:00:00
I am having a problem trying to implement the JavaScriptSerializer
to parse a JSON string received from a server.
I implemented the following code:
responseFromServer = readStream.ReadLine();
JavaScriptSerializer ser = new JavaScriptSerializer();
var dict = new JavaScriptSerializer().Deserialize<Dictionary<string, object>>(responseFromServer);
var status = dict[notificationType];
Debug.WriteLine(status);
I added using System.Web.Script.Serialization;
Visual C# 2010 Express is telling me the namespace name Script
does not exist in the namespace System.Web
. As a result the JavaScriptSerializer
is not valid.
What am I missing to use this, or is there a better way to parse the JSON string?
More From » c#