以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  求助:论坛中发送微信卡片信息 代码运行提示未知编辑错误  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=130991)

--  作者:李孝春
--  发布时间:2019/2/13 21:14:00
--  求助:论坛中发送微信卡片信息 代码运行提示未知编辑错误
老师 这个单独命令窗口提示未知编辑错误  是不是还有什么前提

Dim ur As String = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token={0}"
Dim hc As new HttpClient(Cexp(ur,Functions.Execute("GetQYAccessToken")))
Dim jo As New JObject
Dim ja As New JArray
jo("touser") = "xt"
jo("msgtype") = "textcard"
jo("agentid") = 1000015
Dim ao As New JObject()
ao("title") =  "特朗普" \'标题
ao("description") = "<div class=""gray"">2016年9月26日</div> <div class=""normal"">恭喜你抽中iPhone 7一台,领奖码:xxxx</div><div class=""highlight"">请于2016年10月10日前联系行政同事领取</div>"
ao("url") = "http://news.ifeng.com/a/20170201/50640529_0.shtml" \'连接
ao("btntxt") = "更多" \'图片
jo("textcard")= ao
msgbox(jo.tostring)
hc.Content = jo.ToString()
jo = JObject.Parse(hc.GetData)
If jo("errcode") = "0" Then
    MessageBox.show("消息发送成功!")
Else
    MessageBox.show(jo.ToString)
End If

--  作者:有点甜
--  发布时间:2019/2/13 21:44:00
--  

我测试没问题。

 

你新建一个空白项目,然后拷贝过去测试。

 

如果你要接入微信,请先看看 http://www.foxtable.com/mobilehelp/scr/0174.htm