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);