我tryng解析一个JSON从MtGox正在添加股票。 http://data.mtgox.com/api/2/BTCUSD/money/tickerServiceStack.Text错误的JSON解析
我曾试图用同样的结果有两种方式。
- 的JSONObject D1 = JsonSerializer.DeserializeString(downloadeddata)
- 的JSONObject D2 = JsonObject.Parse(downloadeddata)
当我尝试访问D1 [ “数据”]这似乎是完美串解串=>
{
[data, {
"high" : {
"value" : "600.00000",
"value_int" : "60000000",
"display" : "$600.00",
"display_short" : "$600.00",
"currency" : "USD"
},
"low" : {
"value" : "515.00000",
"value_int" : "51500000",
"display" : "$515.00",
"display_short" : "$515.00",
"currency" : "USD"
},
"avg" : {
"value" : "557.60317",
"value_int" : "55760317",
"display" : "$557.60",
"display_short" : "$557.60",
"currency" : "USD"
},
"vwap" : {
"value" : "554.60404",
"value_int" : "55460404",
"display" : "$554.60",
"display_short" : "$554.60",
"currency" : "USD"
},
"vol" : {
"value" : "20623.02466981",
"value_int" : "2062302466981",
"display" : "20,623.02\u00a0BTC",
"display_short" : "20,623.02\u00a0BTC",
"currency" : "BTC"
},
"last_local" : {
"value" : "527.00000",
"value_int" : "52700000",
"display" : "$527.00",
"display_short" : "$527.00",
"currency" : "USD"
},
"last_orig" : {
"value" : "527.00000",
"value_int" : "52700000",
"display" : "$527.00",
"display_short" : "$527.00",
"currency" : "USD"
},
"last_all" : {
"value" : "527.00000",
"value_int" : "52700000",
"display" : "$527.00",
"display_short" : "$527.00",
"currency" : "USD"
},
"last" : {
"value" : "527.00000",
"value_int" : "52700000",
"display" : "$527.00",
"display_short" : "$527.00",
"currency" : "USD"
},
"buy" : {
"value" : "525.50002",
"value_int" : "52550002",
"display" : "$525.50",
"display_short" : "$525.50",
"currency" : "USD"
},
"sell" : {
"value" : "526.99999",
"value_int" : "52699999",
"display" : "$527.00",
"display_short" : "$527.00",
"currency" : "USD"
},
"item" : "BTC",
"now" : "1392201806575324"
}
]
}
而且当我尝试用其中一种上面两个选项反序列化后的字符串我得到这个
JsonObject d3 = JsonObject.Parse(d1["data"]);
Count = 5
[0]: {[high:{value:600.00000, value_int:60000000]}
[1]: {[display:$600.00, display_short:$600.00]}
[2]: {[currency:USD}, low:{value:515.00000]}
[3]: {[value_int:51500000, display:$515.00]}
[4]: {[display_short:$515.00, currency:USD]}
这是与事实相差太远。而根据我的看法,这个结果是错误的,甚至不是json可解析的。 => {[货币:USD},低:{值:515.00000]}
MS的Javascript串行器工作确定。
那么我做错了什么?
谢谢
大家对同一主题的工作?这是我看到试图解析* ticker *的第三个问题。有没有办法将答案发送给全班? – I4V