示例#1
0
        /// <summary>
        /// 发送短信
        /// </summary>
        /// <param name="receivers">消息接收者</param>
        /// <param name="message">消息内容</param>
        /// <returns></returns>
        public override bool SendMessage(string receivers, string message)
        {
            var request = new ChuangLanRequest
            {
                Mobile  = receivers,
                Content = message
            };

            try
            {
                IMessageSender messageSender = new ChuangLanMessageSender(request);
                messageSender.Send();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(true);
        }
示例#2
0
        /// <summary>
        /// 发送通知短信
        /// </summary>
        /// <param name="channel"></param>
        private void SendMessage(jmp_interface channel)
        {
            //TODO:发送短信提示
            var request = new ChuangLanRequest
            {
                Mobile  = ConfigReader.GetSettingValueByKey("CHUANGLAN.MOBILE.MONITOR"),
                Content = string.Format(ConfigReader.GetSettingValueByKey("CHUANGLAN.CONTENT.MONITOR"), channel.l_corporatename, channel.l_id)
            };

            try
            {
                IMessageSender messageSender = new ChuangLanMessageSender(request);
                messageSender.Send();
            }
            catch (Exception ex)
            {
                AddLocLog.AddLog(1, 4, Request.UserHostAddress, "通道状态检测", ex.ToString());
            }
        }
示例#3
0
        public override bool Send()
        {
            //TODO:发送短信提示
            var request = new ChuangLanRequest
            {
                Mobile  = ConfigReader.GetSettingValueByKey("CHUANGLAN.MOBILE.MONITOR"),
                Content = ConfigReader.GetSettingValueByKey("CHUANGLAN.CONTENT.MONITOR")
            };

            try
            {
                IMessageSender messageSender = new ChuangLanMessageSender(request);
                var            success       = messageSender.Send();
            }
            catch (Exception ex)
            {
                //AddLocLog.AddLog(1, 4, Request.UserHostAddress, "通道状态检测", ex.ToString());
            }
            return(true);
        }