1、需要引用
using System.Web.Script.Serialization;
2、采用方法如下:
List<Student> lists = new List<Student> {
new Student{ Name ="小李", Gender ="男"},
new Student{ Name ="小王", Gender="男"}
};
context.Response.Write( new JavaScriptSerializer().Serialize(lists));
下一篇:几种用c# 拼接Json串的方法
相关新闻
- 小程序登录流程图理解 2020-08-18
- 在C#中获取web.config中的配置信息 2021-08-23
- 小程序open-data头像样式 2021-04-10
- 小程序rich-text 富文本解析图片过大和图片路径的问题 2020-11-25
- C#中去掉字符串的最后一个字符 2020-11-23