我在读取 C# 中的以下 JSON 输出时遇到问题。我对 JSON 语法不太熟悉,但它似乎没有正确格式化,或者我不清楚如何正确反序列化数据:
数组( [label] => Column_Name [column] => column0 )
15 0
数组 ( [0] => 0 [1] => 数组 ( )
[2] => 0 ) {"total":0,"entities":[],"page":0}
C# 中使用的代码很简单:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = WebRequestMethods.Http.Get;
request.Accept = "application/json";
HttpWebResponse response = request.GetResponse() as HttpWebResponse;
Encoding enc = Encoding.GetEncoding(1252);
StreamReader configStream = new StreamReader(response.GetResponseStream(), enc);
var configuration = configStream.ReadToEnd();
JavaScriptSerializer jSerialize = new JavaScriptSerializer();
List[] operations = jSerialize.Deserialize<List[]>(configuration);
我收到的错误是“数组”不是有效的 JSON 原语。假设 JSON 输出中的语法是正确的,我该如何反序列化数据?