以文本方式查看主题

-  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=116025)

--  作者:yifan3429
--  发布时间:2018/3/19 1:44:00
--  日志定时提醒
单独做的日志数据,希望可以向职员在17;00 发出 日志填写提醒 
怎么结合 AgentId   Secret  向可见范围的人员发出信息呢


--  作者:有点甜
--  发布时间:2018/3/19 8:33:00
--  

你做的是微信功能?你搭建和接入微信了没有?

 

定时参考

 

http://www.foxtable.com/webhelp/scr/0657.htm

 

static d1 As Date = Date.today.AddDays(-1)
If d1 <> Date.today AndAlso Date.Now.Hour=17 Then
    d1 = Date.today

    msgbox(123)

end if


--  作者:yifan3429
--  发布时间:2018/3/19 9:12:00
--  
微信已进入
--  作者:有点甜
--  发布时间:2018/3/19 9:15:00
--  

参考2楼,然后主动发信息即可

 

http://www.foxtable.com/mobilehelp/scr/0166.htm

 


--  作者:yifan3429
--  发布时间:2018/3/21 9:13: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
jo
("touser") = "laoliu|zhangsan"
jo
("msgtype") = "text"
jo
("agentid") = 9
jo
("text") = New JObject
jo
("text")("content") = "您好,这是测试信息"
hc
.Content = jo.ToString
jo
 = JObject.Parse(hc.GetData)
If jo("errcode") = "0" Then
    MessageBox.show("消息发送成功!")

Else

    MessageBox.show(jo.ToString)

End
 If

怎么改成向全部的用户发出提醒信息

--  作者:有点甜
--  发布时间:2018/3/21 10:54:00
--  

也可以按部门或标签发送,下面的代码会给两个部门(部门ID分别为3和9)的所有成员发送消息:

 

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
jo("toparty") = "9|3"
jo("msgtype") = "text"
jo("agentid") = 9
jo("text") = New JObject
jo("text")("content") = "您好,这是测试信息"
hc.Content = jo.ToString
jo = JObject.Parse(hc.GetData)
If jo("errcode") = "0" Then
    MessageBox.show("消息发送成功!")
Else
    MessageBox.show(jo.ToString)
End If

 

你合成部门编号,或者合成所有用户账号,然后发送,不就可以了?