【发布时间】:2015-01-12 19:41:52
【问题描述】:
我正在尝试从 VB.NET 切换到 C#;但是我在使用 JSON 时遇到了一些问题。我正在尝试反序列化 JSON 数组。但是,我收到此错误:
无法反序列化当前的 JSON 数组
这是我要反序列化的类:
public class ReturnObject
{
public int id { get; set; }
public string name { get; set; }
public string url { get; set; }
public bool thumbnailFinal { get; set; }
public string thumbnailUrl { get; set; }
public object bcOverlayUrl { get; set; }
public object personalServerOverlayUrl { get; set; }
}
反序列化代码:
Debug.WriteLine(JsonConvert.DeserializeObject<ReturnObject>(richTextBox1.Text));
这是我尝试检索的 JSON 的 Web URL。
http://www.roblox.com/place-thumbnails?params=[{placeId:1818}]
【问题讨论】:
-
显示反序列化的代码
-
Debug.WriteLine(JsonConvert.DeserializeObject
(richTextBox1.Text));添加到主帖
标签: c# arrays json serialization