Translate

Tuesday 8 September 2015

How do I convert a dictionary/List to a JSON String in C#?

using System.Web.Script.Serialization;

 Dictionary<string, string> name = new Dictionary<string, string>();
        name.Add("1", "GKSamy");
        name.Add("2", "Rakshitta");
        string myJsonString = (new JavaScriptSerializer()).Serialize(name);

1 comment:

  1. Excellent blog here! Also your website rather a lot up fast! What web host are you using? Can I am getting your affiliate link to your host? I wish my site loaded up as fast as yours lol

    ReplyDelete