How do I convert a string of json formatted data into an anonymous object?
vb.net using Newtonsoft.Json :
dim jsonstring = "..."
dim foo As JObject = JObject.Parse(jsonstring)
dim value1 As JToken = foo("key")
e.g.:
dim jsonstring = "{"MESSAGE":{"SIZE":"123","TYP":"Text"}}"
dim foo = JObject.Parse(jsonstring)
dim messagesize As String = foo("MESSAGE")("SIZE").ToString()
'now in messagesize is stored 123 as String
So you don't need a fixed structure, but you need to know what you can find there.
But if you don't even know what is inside, than you can enumerate thru that JObject with the navigation members e.g. .first(), .next() E.g.: So you could implement a classical depth-first search and screening the JObject
(for converting vb.net to c#: http://converter.telerik.com/)