简体   繁体   English

在C#中解析Web服务的返回值

[英]Parsing returned value from web service in C#

I am using C# to connect to a web service written in PHP, the issue I am having is how to go about parsing this format that is returned for a few of the calls. 我正在使用C#连接到用PHP编写的Web服务,我遇到的问题是如何解析这种为几次调用返回的格式。

a:2:{i:0;a:6:{s:5:"label";s:13:"Delivery Date";s:5:"value";s:19:"2010-11-08 00:00:00";s:4:"code";s:13:"delivery_date";s:4:"type";s:4:"date";s:6:"rawval";s:19:"2010-11-08 00:00:00";s:2:"id";s:3:"119";}i:1;a:6:{s:5:"label";s:14:"Enclosure Card";s:5:"value";s:9:"Test card";s:4:"code";s:14:"enclosure_card";s:4:"type";s:8:"textarea";s:6:"rawval";s:9:"Test card";s:2:"id";s:3:"118";}}

I understand that the above represents an array with various key value pairs inside, but what I am wondering is if the above format has a specific name and if there is a C# parser out there somewhere for this. 我知道上面的代码表示一个数组,里面有各种键值对,但是我想知道的是上面的格式是否有一个特定的名称,以及是否为此存在C#解析器。

I would assume: 我会假设:

a:2 would represent an array with 2 elements. a:2表示一个包含2个元素的数组。 i:0 would represent an integer (0). i:0代表整数(0)。 s:5 would represent a string of length 5 and contents "label" s:5表示长度为5的字符串,内容为“ label”

This may be serialized. 这可以被序列化。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM