json 格式
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了json 格式相关的知识,希望对你有一定的参考价值。
using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.htmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Web.Script.Serialization; namespace WebApplication1 { public partial class WebForm4 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { OneObj first = new OneObj(); first.ID = 1; first.Name = "张三"; first.Time = DateTime.Now; javascriptSerializer a = new JavaScriptSerializer(); string aa=a.Serialize(first); OneObj ff = a.Deserialize<OneObj>(aa); } } public class OneObj { public int ID { get; set; } public string Name { get; set; } public DateTime Time { get; set; } } }
以上是关于json 格式的主要内容,如果未能解决你的问题,请参考以下文章