Dim url As String = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token={0}"
Dim hc As New HttpClient(CExp(url, Functions.Execute("GetAccessToken")))
Dim jo As New JObject
Dim ja As New JArray
jo("touser") = "ofjtFwBSZ5cNqTKLSKx2TNEAxfBI"
jo("template_id") = "eMuOnDjlsEk41QtKE4tkh-Yb09lqCIq769vYKpzR9yQ" '模板ID
jo("url") = "http://www.foxtable.com"
jo("data") = New JObject()
jo("data")("name") = New JObject()
jo("data")("name")("value") = "Foxtable"
jo("data")("name")("color") = "#173177"
jo("data")("number") = New JObject()
jo("data")("number")("value") = "2"
jo("data")("number")("color") = "#173177"
jo("data")("expDate") = New JObject()
jo("data")("expDate")("value") = "2019年12月27日"
jo("data")("expDate")("color") = "#173177"
jo("data")("expDate") = New JObject()
jo("data")("expDate")("value") = "2019年12月27日"
jo("data")("expDate")("color") = "#173177"
jo("data")("remark") = New JObject()
jo("data")("remark")("value") = "如有疑问,可联系客服QQ:800014337"
jo("data")("remark")("color") = "#173177"
hc.content = jo.Tostring()
jo = JObject.Parse(hc.getdata)
If jo("errcode") = "0" Then
MessageBox.show("模版消息发送成功!")
Else
Messagebox.Show(jo.ToString)
End If