using System;
using System.Web.Script.Serialization;
using System.Collections.Generic;
public partial class Demo : System.Web.UI.Page
{
protected string JSON
{
get
{
return Request.QueryString["json"];
}
}
protected void Page_Load(object sender, EventArgs e)
{
JavaScriptSerializer serializer = new JavaScriptSerializer();
Dictionary<string, object> json = (Dictionary<string, object>)serializer.DeserializeObject(JSON);
object value;
if (json.TryGetValue("name", out value))
{
Response.Write(value.ToString());
}
}
}
.Net解析JSON数据
最新推荐文章于 2020-12-04 09:27:12 发布