111,120
社区成员
发帖
与我相关
我的任务
分享
string s = "{\"content\":{\"features\":\"cpAutoSentence:false\",\"timeout\":\"2016-05-2319:00:00\",\"count\":\"4\",\"gmtCreate\":\"2016-05-2319:00:00\",\"taskStatus\":\"4\",\"taskName\":\"商家处理工单\",\"taskId\":\"43525\",\"workOrderId\":\"10016052502373003\"}}";
JavaScriptSerializer js = new JavaScriptSerializer();
content sn = js.Deserialize<content>(s);
Response.Write(sn.taskName);//注意这行,打出来是空白的,没有值,本来应该显示“商家处理工单”
public class content
{
public string features { get; set; }
public string timeout { get; set; }
public string count { get; set; }
public string gmtCreate { get; set; }
public string taskStatus { get; set; }
public string taskName { get; set; }
public string taskId { get; set; }
public string workOrderId { get; set; }
}
public class container
{
public content content { get; set; }
}
string s = "{\"content\":{\"features\":\"cpAutoSentence:false\",\"timeout\":\"2016-05-2319:00:00\",\"count\":\"4\",\"gmtCreate\":\"2016-05-2319:00:00\",\"taskStatus\":\"4\",\"taskName\":\"商家处理工单\",\"taskId\":\"43525\",\"workOrderId\":\"10016052502373003\"}}";
JavaScriptSerializer js = new JavaScriptSerializer();
var sn = js.Deserialize<container>(s);
Console.Write(sn.content.taskName);//注意这行,打出来是空白的,没有值,本来应该显示“商家处理工单”