Example #1
0
        /// <summary>
        /// 微信发送(企业号)
        /// </summary>
        /// <param name="content">消息内容</param>
        /// <param name="list">用户列表</param>
        /// <returns></returns>
        public void WeChatSend(string content, List <UserEntity> list)
        {
            string SystemName   = Config.GetValue("SystemName");//系统名称
            string SalesManager = "";

            foreach (var item in list)
            {
                if (SalesManager != "")
                {
                    SalesManager += "|";
                }
                SalesManager += item.F_Account;
            }
            var text = new SendText()
            {
                agentid = Config.GetValue("ApplicationId"), //应用ID
                touser  = SalesManager,                     //@all:所有人,多个用户名用 “|”隔开
                text    = new SendText.SendItem()
                {
                    content = content
                }
            };
            MessageSendResult result = text.Send();//发送消息,并返回结果
        }
Example #2
0
        /// 文字
        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            SendText sendText = new SendText(remoteEP, 11, 10);

            sendText.Send(txtsend.Text);
        }