大学IT网 - 最懂大学生的IT学习网站! QQ资料交流群:367606806
当前位置:大学IT网 > C#技巧 > 解析Json数据

解析Json数据

关键词:解析Json解析Json  阅读(905) 赞(11)

[摘要]本文是对解析Json数据的讲解,对学习C#编程技术有所帮助,与大家分享。
statusJson sj = new statusJson()
{
    ShipmentNum = "555555",
    Status1 = "05",
    Warehouse = "SHANGHAI",
    Company = "AAA"
};
 
List<statusJson> sjlist = new List<statusJson>()
{
    new statusJson()
    {
      ShipmentNum = "555557",
      Status1 = "200",
      Warehouse = "SHANGHAI",
      Company = "AAA"  
    },
    new statusJson()
    {
      ShipmentNum = "555558",
      Status1 = "200",
      Warehouse = "SHANGHAI",
      Company = "AAA"  
    }
};
string getJson = SerializationHelper.ObjecttoJson(sjlist);
 
public string UpdateStatus(string getJson)
{
    List<statusJson> strstatus = JavaScriptHelper.JSONtoObject<List<statusJson>>(getJson);           
    try
    {
        foreach (statusJson st in strstatus)
        {
            string oldstatus = "";
            string newstatus = st.Status1;
            string restatus = reStatus(newstatus);
            string Shipment_ID = st.ShipmentNum;
        }
    }    
}


相关评论