原文发布时间为:2012-03-21 —— 来源于本人的百度文章 [由搬家工具导入]
NameValueCollection nvc =newNameValueCollection(Request.Form);
nvc.Add("foo","bar");
var dict =newDictionary<string,string>();
foreach(string key in nvc.Keys)
{
dict.Add(key, nvc[key]);
}
string json =newJavaScriptSerializer().Serialize(dict);
Console.WriteLine(json);