public void ProcessRequest (HttpContext context) {
context.Response.ContentType = "text/plain";
int localserid = Convert.ToInt32(context.Request.Form["localserid"]);
int remoteserid = Convert.ToInt32(context.Request.Form["remoteserid"]);
string jsonData = context.Request.Form["jsonData"];
Newtonsoft.Json.Linq.JArray jary = (Newtonsoft.Json.Linq.JArray)JsonConvert.DeserializeObject(jsonData);
IList<_tmpClass> myobjs = new List<_tmpClass>();
for (int i = 0; i < jary.Count; i++)
{
_tmpClass mytmp = (_tmpClass)JsonConvert.DeserializeObject(jary[i].ToString(),typeof(_tmpClass));
myobjs.Add(mytmp);
}
context.Response.Write(myobjs[0].Sql);
}
private class _tmpClass
{
private int _tid;
private string _table,_sql;
public int TableID { get { return _tid; } set { _tid = value; } }
public string Table { get { return _table; } set { _table = value; } }
public string Sql { get { return _sql; } set { _sql = value; } }
}
json.net转换数组类型
最新推荐文章于 2024-06-17 09:43:23 发布