c# 4.0 - Get value from json in c# -


is the json string given below which is given to me as label Jason string

If you have any ideas, then share me ....

  {"response": {"metinfo" : ["Timestamp": "2014-04-28T11: 55: 00.689 + 0000"}, "View": [{"Type": "Search displayed view tip", "Viewed": 0, "Result": [ Relevance ": 1.0," location ":" "" "dot", "name": "22.32963 73.24493", "display": {"latitude": 22.3296299, "longitude": 73.244923}, "map "" "{{" Latitude ": {" Latitude ": 22.3386231," Longitude ": 73.2352007}," Right below ": {" Latitude ": 22.3206367," Longitude ": 73.2546453}}," Address ": {" Additional Data 1.0, "district": 1.0, "distance": 32.4, "Milanleval": "", " "Location": "LINK_939680173_L", "Location type": "point", "display status": "location": {"country": 1.0, "state", "postal code": "location": {"location ID" ": {" Latitude ": 22.3296022," longitude ": 73.2452373}," map view ": {" left to left ": {" latitude ": 22.333 9 6," longitude ": 73 .24433}, "Right below": {"Latitude": 22.3287, "Longitude": 73.24571}}, "Address": `****` {label": "Harini," Vadodara "," Vadodara " "India", "State": "JJ", "County": "Vadodara", ",", "PostalCode": "India", "State": "India", "State": "Harinie", "Vadodara" : "{0}" "Additional Data": [{"Value": "India", "Key": "Country Name"}, {"Value": "Gujarat", "Key": "StateName"}]}}} }}}}}  

download Jason DLL of Newtonsoft.

Then you can use JsonConvert.DeserializeObject or JsonConvert.SerializeObject

UPDATE: Here are instructions for installing it through NUG for Visual Studio

< P>

Here is an example of how to use it.

  string json = @ "{'name': 'bad boys', 'release date': '1995-4-70000 00: 00', 'styles': ['action' 'Comedy']} "; Movie M = JsonConvert.DeserializeObject & lt; Movie & gt; (Json); String name = m.Name;  

Just create an object for your JSON string (for each value) and then when you call deserializeObject, you referenced the label using MyObject.label Can


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -