How could you convert a string of JSON to a C# NameValueCollection simply, preferably without using a 3rd party parser?
How could you convert a string of JSON to a C# NameValueCollection simply, preferably
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m not sure why everyone is still recommending JSON.NET for deserialization of JSON. I wrote a blog post on how to deserialize JSON to C#.
In short, it’s like this:
Be sure to add a reference to System.Web.Extensions.dll.
Note:
I usually deserialize to
dynamic, so I’m assuming thatNameValueCollectionwould work. However, I haven’t verified if it actually does.