企业号
# 企业号
# 常规参数
//企业号应用ID,这里不方能写死,因为不同企业ID会不同,故做一个调用码
string agentid = MenuD.GetInstance().GetAppIDBYModelname("nbwans", "DiYaWu");
//系统网址-微信打开的默认网址
string XiTongMoRenWangZhi = XiTongCanShuD.GetInstance().GetXiTongCanShu("nbwans", "XiTongMoRenWangZhi");
1
2
3
4
2
3
4
# 发送网页
//文章集-一次性可以发送多编
Snews news = new Snews();
//指定接收消息的成员,成员ID列表(多个接收者用‘|’分隔,最多支持1000个)。
//特殊情况:指定为”@all”,则向该企业应用的全部成员发送
news.touser = "admin|chenyue";
news.toparty= ""; //指定接收消息的部门ID
news.totag = ""; //指定接收消息的标签
//第一编文章
articles at1 = new articles();
//主题
at1.title = "申请人:["+ uDt.Rows[0]["DaiKuanShenQingRen"].ToString() + "]需要您进行评估";
//描述
at1.description = "小区名:[" + uDt.Rows[0]["XiaoQuMingChen"].ToString() + "]";
//打开的地址 请带上agentid 方便自动登录
at1.url = XiTongMoRenWangZhi + "Weixin/DiYaWu/DiYaWuShiKan.aspx?agentid="+ agentid + "&id=" + id;
news.agentid = agentid;
news.articles.Add(at1);
Companyconfig Gs = CompanyD.GetInstance().GetCompanyconfig("nbwans");
WXCommon.SendJson(Gs, Send.SendNews(news), "DiYaWu");
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 文本内容
SText txt = new SText();
txt.touser = touser;
txt.totag = totag;
txt.toparty = toparty;
txt.agentid = agentid;
txt.Content = "";//文件不要超过600个
WXCommon.SendJson(companyCG, Send.SendText(txt), agentid);
1
2
3
4
5
6
7
2
3
4
5
6
7
上次更新: 2022/04/26, 16:00:33