关于vb.net转json的信息( 三 )


vb.net json 数据处理问题你只获取接口的每个 obj_name 和speed 值的话,你完全没必要当json来处里 , 你可以直接截取字符串就可以了 。用substring函数
【VB.NET】这个json怎么解析??用的是Newtonsoft.Json.dll先如下程序集
Imports System.Web.Script.Serialization
Function StringToObject(content As String) As Object
Dim jss As New JavaScriptSerializer()
Return jss.DeserializeObject(content)
End Function
Dim test1 As Dictionary(Of String, Object) = StringToObject("{
"Chr(34)"objects"Chr(34)": {
"Chr(34)"minecraft/sounds/entity/rabbit/attack2.ogg"Chr(34)": {
"Chr(34)"hash"Chr(34)": "Chr(34)"4b90ff3a9b1486642bc0f15da0045d83a91df82e"Chr(34)",
"Chr(34)"size"Chr(34)": 7268
},
"Chr(34)"minecraft/sounds/entity/shulker/close5.ogg"Chr(34)": {
"Chr(34)"hash"Chr(34)": "Chr(34)"e555fcece121879fe0becbada9d01dea27ab153d"Chr(34)",
"Chr(34)"size"Chr(34)": 5376
},
"Chr(34)"minecraft/lang/ga_IE.lang"Chr(34)": {
"Chr(34)"hash"Chr(34)": "Chr(34)"a108f19142820b3573a658d40950ba3317b65c15"Chr(34)",
"Chr(34)"size"Chr(34)": 142847
},
"Chr(34)"minecraft/sounds/mob/horse/leather.ogg"Chr(34)": {
"Chr(34)"hash"Chr(34)": "Chr(34)"20abaa7d3b0baa105bc6023d5308f1e5d76acc41"Chr(34)",
"Chr(34)"size"Chr(34)": 11577
}}
}
")
Dim cc As Dictionary(Of String, Object) = DirectCast(test1.Values(0), Dictionary(Of String, Object))
Dim dd = cc.Values(0)("hash")
这样就可以遍历 hash值了
vb.net转json的介绍就聊到这里吧 , 感谢你花时间阅读本站内容,更多关于、vb.net转json的信息别忘了在本站进行查找喔 。

推荐阅读