JSON for string array in C #

I have a JSON string exactly the same

[ { "markers": { "0": "13.775801,100.611199", "1": "13.775801,100.611199" } } ] 

I would like to make a list of markers with a string array. My JSON format is exactly the same with this format. Perhaps this is not a change. How can i do this?

+4
source share
2 answers

JavaScriptSerializer is a good option. This is in the .NET Framework v3.5, so you will not need any third-party library.

Here is a small example of how you can use it, although if you introduce JavaScriptSerializer on Google, you will have many examples of how to parse it.

Basically, you need to determine the type that matches the JSON format you need to parse and use the Deserialize method of the JavaScriptSerializer class.

Edit:

See @ Marc Gravell answer for a similar question: JSON parsing using Json.net

+2
source

You can try using the DataContractJsonSerializer , or you can try a little easy to learn the library on codeplex JSON.Net .

Hope this helps,

Hi

+1
source

All Articles