I have a problem if my json file looks like
{"Numbers": "45387", "Words": "space buckets"}
I can read it just fine, but if it looks like this:
{"Home": {"Numbers": "45387", "Words": "space buckets"},
"Something": {"Numbers": "12345", "Words": "Kransky"}}
I do not receive any information. I have no idea how to switch between Main and Something! Download JSON with this "nested" information using this code,
var ser = new DataContractJsonSerializer(typeof(myInfo));
var info = (myInfo)ser.ReadObject(e.Result);
// Class used to store my information
[DataContract]
public class myInfo
{
[DataMember(Name="Numbers")]
public int number
{ get; set; }
[DataMember(Name="Words")]
public string words
{ get; set; }
}
.
DataContract, . [DataContract, Name= "Main" ], , .
"main" , . var ser = new DataContractJsonSerializer (typeof (myInfo), "Main" ),
: "Main" ". Encountered" Element " " root ", namespace ''.
json-. json.NET, json .
, - !