Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have JSON string just like that

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

I would like to do markers list with string array.My JSON format is exactly same with that format.It might not be change anymore.How can I do for that ?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

JavaScriptSerializer is a good option. It is in .NET Framework v3.5, so you won't need any 3rd Party library.

Here is an small example of how you can use it, although if you enter JavaScriptSerializer on Google, you will have lots of examples of how to parse it.

Basically, you need to define a type that fits the JSON format you need to parse, and use the Deserialize method of JavaScriptSerializer class.

Edit:

See @Marc Gravell's answer for a similar question: parsing JSon using JSon.net

share|improve this answer

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

Hope this helps,

Regards

share|improve this answer
    
Thanks Chintan :) –  kst Mar 4 '11 at 6:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.