q1156152188
NetBreak
2015-01-29 05:36
采纳率: 25%
浏览 2.8k

C#怎么解析一段字符串

我的字符串格式是这样的,也可以说是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"}]
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

6条回答 默认 最新

  • LCL_data
    十八道胡同 2015-01-29 05:47
    点赞 评论
  • q107770540
    兔子党-督察 2015-01-29 05:50
    点赞 评论
  • oyljerry
    oyljerry 2015-01-29 05:52

    JObject jo = JObject.Parse(jsonText);

    读取字符串,生成一个对象
    http://blog.csdn.net/coolszy/article/details/8606803

    点赞 评论
  • q1156152188
    NetBreak 2015-01-29 05:56

    是winform程序,

    点赞 评论
  • q1156152188
    NetBreak 2015-01-29 06:43

    哪位大神给我一个实例让我看一下啊!我只是刚入行的菜鸟而已,那些东西太高深了,看不懂啊

    点赞 评论
  • upc_young
    upc_young 2015-03-20 09:39

    如果要反序列化为强类型的对象,你需要声明一个对应的类。
    如果没有特别的需求,可以选择反序列化为Dictionary、DataTable等对象。
    可依赖JavaScriptConverter实现自己的反序列化器,详见msdn文档(https://msdn.microsoft.com/zh-cn/library/system.web.script.serialization.javascriptconverter.aspx)

    点赞 评论

相关推荐