我的字符串格式是这样的,也可以说是Json字符串,有没有什么方法可以把这段字符串给解析成成实体类,求大神指教啊
[{"OrderID":"0","No":"1","Item1":"0","Item2":"600","Item3":"100","Item4":"0","Item5":"10","Item6":"200","Item7":"200","Item8":"300","Item9":"0","Item10":"0","ContelNameAndTel":"","Item1m":"2300","Item2m":"300","Item3m":"100","Item4m":"300","OrganizeID":"0","ID":"17094","Jhbh":"","Jhrq":"2015/1/8 0:00:00","Iffb":"0","Jdfmc":"辰达集团 (海口市外办)","Ydr":"","Ydrdh":"","Sfzh":"","Ifxyydr":"0","Contact":"","ContactTel":"","Krrs":"3","MLPlanID":"0","Jhhx":"","Ifly":"0","Ysld":"","Xxly":"","Zdfwy":"","Fzr":"","Remark":"","Ifsybj":"0","Fjfwry":"","FjfwryID":"0","Fjkssj":"","Fjjssj":"","Fwkssj":"","Fwjssj":"","Ghzt":"0","Jszt":"0","Ddfy":"1410","Mdfy":"3100","DdfyDouble":"0","MdfyDouble":"0","Cph":"","State":"0","DelState":"0","CreateName":"","CreateDate":"0001/1/1 0:00:00","Ifmj":"0","Sxrs":"1","ServiceTypeId":"","ServiceTypeName":"","ServiceStateId":"","ServiceStateName":"","ProtectionTypeId":"","ProtectionTypeName":"","WebUserId":"","WebUserSubId":"","Hbh":"","Hblb":"0","Hkgssx":"0","Ddhx":"","PaymentId":"","PaymentName":"贵宾卡","HadTypeId":"","HadTypeName":"其它","VipRoomId":"","VipRoomName":"","HadNatureId":"","HadNatureName":"","VipRoomTypeId":"","VipRoomTypeName":"","AppUserID":"0","AppUserName":"","PlanModel":"","CustomerName":"","Position":"","Unit":"","QianDR":"","JieDY":"","DanJH":"","IFHaveMeals":"0","HaveMealsNo":"0","IfReservedSeating":"0","IfSeated":"0","TheBellboyID":"0","TheBellboyName":"","TheBellboyNo":"0","TheBellboyM":"0","YsRS":"2","Fwy":"","fwList":"","Yby":"","ybList":"","MainCustomer":"Sébastien Hamel(Sebastien Hamel)(塞巴斯蒂安·哈梅尔)、Pam McConnell、Elena Pierce、Simon Langerlier","MainPosition":"加拿大城镇联盟国际关系部主席","MainSeat":"","SxCustomer":"","VipCar":"","carList":"","CardTypeName":"","IsSign":"0","IsSendSms":"0"}]
参考下:
http://www.cnblogs.com/echolxl/p/3594112.html?utm_source=tuicool
一般常用的是JSON.NET
http://www.cnblogs.com/ambar/archive/2010/07/13/parse-json-via-csharp.html
JObject jo = JObject.Parse(jsonText);
读取字符串,生成一个对象
http://blog.csdn.net/coolszy/article/details/8606803
如果要反序列化为强类型的对象,你需要声明一个对应的类。
如果没有特别的需求,可以选择反序列化为Dictionary、DataTable等对象。
可依赖JavaScriptConverter实现自己的反序列化器,详见msdn文档(https://msdn.microsoft.com/zh-cn/library/system.web.script.serialization.javascriptconverter.aspx)
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。