码迷,mamicode.com
首页 > Web开发 > 详细

后台 返回序列化的 JSon

时间:2016-01-05 00:07:43      阅读:180      评论:0      收藏:0      [点我收藏+]

标签:

 
string msg = context.Request["msg"];
            JavaScriptSerializer js = new JavaScriptSerializer();

            Dictionary<string, string> dic = new Dictionary<string, string>()
            {
                {"Time1", "2015.11.251111" }
            };
            dic.Add("Time", "2015.11.25");
            dic.Add("Data", "2013.11.10");

            string jsonstr = js.Serialize(new
            {
                Url = msg,
                People = new
                {
                    Name = "大头",
                    Age = "19"
                },
                Dic = dic
            });

            HttpContext.Current.Response.Write(jsonstr);
 

后台 返回序列化的 JSon

标签:

原文地址:http://www.cnblogs.com/demoC/p/5100538.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!