Json字符转化成对象

//后台  

string jsonArray = "";//此处json对象的属性必须和类库一样
  JavaScriptSerializer json = new JavaScriptSerializer();
  List<payParameter> list = new List<Reconciliation.payParameter>();
  payParameter user = json.Deserialize<payParameter>(jsonArray);

//类库

    [Serializable]
    public class payParameter
    {

        public string TotalItems { get; set; }
            public SaveReconciliationDtoList[] SaveReconciliationDtoList { get; set; }

    }

    [Serializable]
    public class SaveReconciliationDtoList
    {
        public string MerCustId { get; set; }
        public string UsrCustId { get; set; }

    }

 

posted @ 2014-01-06 19:26  一个人的风  阅读(189)  评论(0编辑  收藏  举报