windows phone 7 - Retrieve Dictionary Values from json File -


I am trying to parse a json file that is found from the file stream. My Jason data is

  {"appname": "sine", "taborder": ["something", "cheese", "is", "gone", "wrong"]}   

I am storing data in a string and am trying to destrate data. I'm trying to show the keys in the warning box as follows:

  string jsonString = contents; // "{'name': 'Bill', 'Ag: 53}"; You deserializedUser = ReadToObject (jsonString); Var str = deserializedUser.mainDict.Keys.ToArray (); MessageBox.Show (str.ToString ());   

But I'm getting the key value as "zero", how to get the fair values, please help me .....

I hope it helps

  to renew protected override zero ( System.windows.navigation.navigation and searchgroups e) {JavaScriptRequest obj = DeserializeJavaScriptRequest (typeof (JavaScriptRequest), resource 1. test) as JavaScriptRequest; MessageBox.Show (obj.appname + "|" + obj.taborder [0]); } Public Object DeserializeJavaScriptRequest (type typedeserialize, string eValue) {type T = typingarialize; // Get Constructor Info ConstructorInfo [] ci = t.GetConstructors (); Object reflectOb = CI [0]. Invoke (empty); MemoryStream confirm_ms = new memorystream (encoding. UTF8.GetBytes (eValue)); DataContractJsonSerializer confirm_ser = New DataContractJsonSerializer (typedeserialize); ReflectOb = confirm_ser.ReadObject (confirm_ms); Confirm_ms.Close (); Reflection Ob. }   

and I created a square

  public class JavaScriptRequest {public string appname {get; Set; } Public string [] taborder {get; Set; }}    

Comments