Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
主动发送文本消息,因为我的是安全模式,请问如何对消息进行加密!
以下是主动发送文本消息的示例代码,你可以在命令窗口运行测试:
Dim
jo As New JObject
jo("touser") = "ofjtFwBSZ5cNqTKLSKx2TNEAxfBI"
jo("msgtype") = "text"
jo("text") = New
JObject
jo("text")("content") = "您好,我是Foxtable"
Dim URL As
String = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token={0}"
Dim hc As
New HttpClient(CExp(URL, Functions.Execute("GetAccessToken")))
hc.Content = jo.ToString()
jo = JObject.Parse(hc.GetData())
If jo("errcode") =
"0"
Then
MessageBox.Show("消息发送成功")
Else
MessageBox.show("消息发送失败,原因:"
& vbcrlf &
jo("errmsg").ToString)
End
If