Can not convert the json to LINQ

Feb 29, 2012 at 10:10 PM

I want to convert a json response to simple LINQ. 

Here is the JSON result:

{
   "data":{
      "lastName":"???",
      "agreeExchange":{
         "show":"false"
      },
      "funded":"true",
      "nasdaq":{
         "professional":"false",
         "agree":"true"
      },
      "authToken":"??????",
      "nyse":{
         "professional":"false",
         "agree":"true"
      },
      "delayedQuotes":"false",
      "access":"granted",
      "professional":"false",
      "requiresAccountCreation":"false",
      "version":"tool/2012.02.28.18.12/",
      "agreePro":{
         "show":"false"
      },
      "opera":{
         "professional":"false",
         "agree":"true"
      },
      "firstName":"*****"
   },
   "action":"auth.login"
}

 

 

Here is the code:

string result = reader.ReadToEnd();

Newtonsoft.Json.Linq.JToken jObject = Newtonsoft.Json.Linq.JObject.Parse(result);

string String1 =(String) jObject["action"];

string authorizationcode =(String) jObject["authToken"];

The action is returned with auth.login but the authtoken is not found.  

I debug the jObject, it seems that it is decoded to 2 string, one is the "Data" and the other is "action".

Can json.net decode multiple level to lower level?

Thanks for the help!