{"message":"ok","nu":"9356359685","ischeck":"1","com":"yuantong","status":"200","condition":"F00","state":"3","data":[{"time":"2014-09-01 21:19:06","context":"甘肃省武威市公司 已签收 ","ftime":"2014-09-01 21:19:06"},{"time":"2014-09-01 09:09:28","context":"甘肃省武威市公司 派件中 ","ftime":"2014-09-01 09:09:28"},{"time":"2014-09-01 09:06:27","context":"甘肃省武威市公司 已收入 ","ftime":"2014-09-01 09:06:27"},{"time":"2014-08-31 19:53:47","context":"甘肃省兰州市公司 已发出 ","ftime":"2014-08-31 19:53:47"},{"time":"2014-08-31 19:17:41","context":"甘肃省兰州市公司 已收入 ","ftime":"2014-08-31 19:17:41"},{"time":"2014-08-28 23:44:26","context":"广东省深圳市横岗公司 已打包 ","ftime":"2014-08-28 23:44:26"},{"time":"2014-08-28 23:19:12","context":"广东省深圳市横岗公司 已收件 ","ftime":"2014-08-28 23:19:12"},{"time":"2014-08-28 21:55:35","context":"广东省深圳市横岗公司 已收件 ","ftime":"2014-08-28 21:55:35"}]}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestJson
{
public class PostalDeliveryModel
{
private string message = string.Empty;
private string nu = string.Empty;
private List<SingalData> data = new List<SingalData>();
// Puclic的名字需要与Json字符串相同,但是忽略大小写
public string Message
{
get { return this.message; }
set { this.message = value; }
}
public string Nu
{
get { return this.nu; }
set { this.nu = value; }
}
public List<SingalData> Data
{
get { return this.data; }
set { this.data = value; }
}
}
public class SingalData
{
private DateTime time = System.DateTime.Now;
private string context = string.Empty;
private DateTime ftime = System.DateTime.Now;
public DateTime Time
{
get { return this.time; }
set { this.time = value; }
}
public DateTime FTime
{
get { return this.ftime; }
set { this.ftime = value; }
}
public string Context
{
get { return this.context; }
set { this.context = value; }
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Web.Script.Serialization; // 此命名空间对应的框架是 System.Web.Extensions
namespace TestJson
{
public class Program
{
public static void Main(string[] args)
{
string jsonStr = new StreamReader("JsonData.txt").ReadToEnd();
PostalDeliveryModel mode = new JavaScriptSerializer().Deserialize<PostalDeliveryModel>(jsonStr);
Console.ReadKey();
}
}
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有