【发布时间】:2018-03-06 12:21:12
【问题描述】:
我有一个这样的 JSON
"type" : "info",
"gameid" : "info",
"userid" : "info",
"actions" :
[
{
"actid" : "info",
"type" : "info",
"amount" : "info",
"timestamp" : "info"
},
],
"i_gamedesc" : "{SystemID}:{GameType}",
"hmac" : "..."
并像这样将 c# 代码对应到这个 json
[JsonProperty(PropertyName ="gameid")]
public int gameId { get; set; }
[JsonProperty(PropertyName = "userid")]
public int userId { get; set; }
问题是我不知道如何转换actions JSON 数组,如上面的代码。一些帮助?
【问题讨论】:
-
为什么不在 C# 中尝试使用 List、Array 或 IEnumerable 来表示动作?
-
可能与此处相关:Easiest way to parse JSON response.
-
分享完整的 JSON。
标签: c# .net arrays json json.net