欢迎访问我的博客 https://javascript.shop

Request.Form to JSON

原文发布时间为: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);
posted @ 2017-07-15 14:20  孑孓子  阅读(288)  评论(0编辑  收藏  举报
欢迎访问我的博客 https://javascript.shop