将 json 字符串解析为对象时出现错误。我正在使用 system.json 来解析 json 字符串。
JSON 文件:(注意:我无法更改此 json 文件的结构,因为它是生成的)
{
title: "My Title",
log: "",
nid: "1234",
type: "software",
language: "EN",
created: "1364480345",
revision_timestamp: "1366803957",
body: {
und: [
{
value: "abc",
summary: "def"
}
]
}
}
C# 代码:
string jsonString = new WebClient().DownloadString(".......MyJson.json"); //For test purpose
var obj = JsonObject.Parse (jsonString); ///<--- At this line the exception is thrown
例外:
System.ArgumentException has been thrown.
Invalid JSON string literal format. At line 1, column 2
如何解决这个问题?
提前致谢!