Dim postdata As String ="{""type"":""news"",""offset"":""0"",""count"":""2""}"
Dim dr As DataRow =DataTables("ACCESS_TOKEN").Find("公众号名称 = '黔源科技'")
Dim url = String.Format("https://api.weixin.qq.com/cgi-bin/material/batchget_material?access_token=" & dr("ACCESSTOKEN") & "")
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 jsonString = Functions.Execute("HttpPost",url, ms) '通过POST向接口传输菜单数据,并取得返回结果
Dim json As String = jsonString
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
MessageBox.Show(json)
dr("voice_count") = data.voice_count
MessageBox.Show(dr("video_count"))
Next
End Using