how to convert NameValueCollection to JSON string?

后端 未结 4 651
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-28 10:38

I tried:

  NameValueCollection Data = new NameValueCollection();
  Data.Add(\"foo\",\"baa\");
  string json = new JavaScriptSerializer().Serialize(Data);
         


        
4条回答
  •  执念已碎
    2020-11-28 10:52

    If your dictionary is not intended to contain many entries, you can use the class: System.Collections.Specialized.ListDictionary

提交回复
热议问题