Thursday, May 17, 2018

c# - i want to get particular field value from json

You can define your custom class:


internal class Data
{
public Rate rate;
}
internal class Rate
{
public float combined_rate;
}

And deserialize this string to object:


var s = new JavaScriptSerializer();
var o = s.Deserialize(json);
var value = o.rate.combined_rate;

Also, you can extract other values from your string, just add new fields to Data class.

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...