dsgw3315 2017-04-14 13:57
浏览 100

Php数组转换为C#json

How can I convert php array to c# string(xml or json)?

  [ID] => 1
  [CreditNo] => 2
  [Date] => 2017-06-15

I have found some source but they dont work

  • 写回答

1条回答 默认 最新

  • drug95107 2018-07-03 07:27
    关注

    Convert the json to xdocument and get the results

    var xml = XDocument.Load(JsonReaderWriterFactory.CreateJsonReader(
        Encoding.ASCII.GetBytes(JsonString), new XmlDictionaryReaderQuotas()));
    
    var resultlist=xml.Descendants("item"); // to get the direct node value result as list
    
    评论

报告相同问题?

悬赏问题

  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 有没有帮写代码做实验仿真的
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥30 vmware exsi重置后登不上
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?