Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用VB.net在json API中搜索_Json_Vb.net - Fatal编程技术网

使用VB.net在json API中搜索

使用VB.net在json API中搜索,json,vb.net,Json,Vb.net,大家好,我想在一个json字符串中搜索并获得一个属性值,我有以下代码 Dim ser As JObject = JObject.Parse(reader.ReadToEnd()) Dim data As List(Of JToken) = ser.Children().ToList Response.Write(ser) 这是我的出局 {“success”:true,“result”:{“access_token”: “T1RLAQLTD+AB7uveLzir/oF

大家好,我想在一个json字符串中搜索并获得一个属性值,我有以下代码

    Dim ser As JObject = JObject.Parse(reader.ReadToEnd())

    Dim data As List(Of JToken) = ser.Children().ToList

    Response.Write(ser)
这是我的出局

{“success”:true,“result”:{“access_token”: “T1RLAQLTD+AB7uveLzir/oF8EKbu32EJIRDHKkx5O/W2+RI3CBWT8UOUAADF7OJIJ6M20NPRYZWRWNLDA99FZG/PNN7EL8IWS9PKVAPQTPDHIPHUPUPNJYOTLKPJRUE0ZBGPTPAKYRTG6LPW2VOXEQH7T3MSZMSSCSQVQWMC2D4FBDZU2JKGSF86RET2YDFW9VJJJK2E9K2YDRE9KZPRHKZQQJJJ9PF2IK2E2EVO2YYYY2YY2YYYYK8K8K8KKZKZYYK8K8KKKZYYK8JJJJJJJJJJJJJJJ8J8K8JJJJ8, “token_type”:“bearer”,“expires_in”:604800}


我想获取“访问令牌”的值,谢谢

您无需先使用ToList()即可获取该值:


我还没有检查它,但我认为它应该可以工作。

也许它很有用:访问的JObject值的键值无效:0。应为对象属性名称。是的,它有错误。请现在试一试
Dim myAccessToken as String = ser("result")("access_token").Value(Of String)()