以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  求助:有点蓝老师及各位老师请多多指教下 还是JSON问题  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=91588)

--  作者:李孝春
--  发布时间:2016/10/13 22:22:00
--  求助:有点蓝老师及各位老师请多多指教下 还是JSON问题
{ 
    "list": [ 
        { 
            "ref_date": "2014-12-08", 
            "msgid": "10000050_1", 
            "title": "12月27日 DiLi日报", 
            "int_page_read_user": 23676, 
            "int_page_read_count": 25615, 
            "ori_page_read_user": 29, 
            "ori_page_read_count": 34, 
            "share_user": 122, 
            "share_count": 994, 
            "add_to_fav_user": 1, 
            "add_to_fav_count": 3
        } 
 	 //后续会列出该日期内所有被阅读过的文章(仅包括群发的文章)在当天的阅读次数等数据
    ]
}
上面格式的json我仿照你之前的写法,结果提示找不到list是不是我理解错误了呢?
Dim postdata As String ="{""begin_date"": ""2015-10-13"", ""end_date"": ""2015-10-13""}"
Dim url = String.Format("https://api.weixin.qq.com/datacube/getarticlesummary?access_token=jWwr17bx9IlRG__YdtKfJfLzUzLecGInR8Rq2T5EiOlvjW5DJIcuyZe3A9D2OgZ5FcoM3g3Ydbyh5O9bfI3rx_R7sNv3aw5WecBJvpuzPx4v01ZmjpEXEi9Wt89yjo_WVXZhAEAIKM")
Using ms As New System.IO.MemoryStream()
Dim bytes = ConvertHelper.EncodingToBytes(postdata, System.Text.Encoding.UTF8)
ms.Write(bytes, 0, bytes.Length)
ms.Seek(0, System.IO.SeekOrigin.Begin)
Dim json As String = Functions.Execute("HttpPost",url, ms)
Dim ScriptControl As Object, data  As Object, JscriptCode As String
JscriptCode = "function toObject(json) {eval(""var o=""+json);return o;}"
ScriptControl = CreateObject("MSScriptControl.ScriptControl")
With ScriptControl
    .Language = "Javascript"
    .Timeout = -1
    .AddCode(JscriptCode)
    data = .Run("toObject", json)
End With
output.Show(json)

For Each obj As object In data.List
    ’For Each List As object In obj.List
        output.Show(List.title)
  ’Next
Next
End Using


--  作者:有点蓝
--  发布时间:2016/10/13 22:29:00
--  
看上一个贴,不要老是重复发帖