Пример #1
0
        /// <summary>
        /// 同步
        /// </summary>
        /// <param name="templateCode">模版</param>
        /// <param name="liRecNum">单个电话</param>
        /// <param name="paramString">变量</param>
        public static void SendSMSsingle(string templateCode, string recNum, Dictionary <string, string> paramString)
        {
            SendSmsRequest re = new SendSmsRequest
            {
                TemplateCode = templateCode,
                RecNum       = recNum,
                ParamString  = paramString
            };

            ALiYunSMS.SendSMS(re);
        }
Пример #2
0
        /// <summary>
        /// 同步
        /// </summary>
        /// <param name="templateCode">模版</param>
        /// <param name="liRecNum">电话集合</param>
        /// <param name="paramString">变量</param>
        public static void SendSMMass(string templateCode, List <string> liRecNum, Dictionary <string, string> paramString)
        {
            SendSmsRequest re = new SendSmsRequest
            {
                TemplateCode = templateCode,
                LiRecNum     = liRecNum,
                ParamString  = paramString
            };

            ALiYunSMS.SendSMS(re);
        }
Пример #3
0
        /// <summary>
        /// 异步
        /// </summary>
        /// <param name="templateCode">模版</param>
        /// <param name="liRecNum">单个电话</param>
        /// <param name="paramString">变量</param>
        /// <returns></returns>
        public static async Task <bool> SendSMSsingleAsync(string templateCode, string recNum, Dictionary <string, string> paramString)
        {
            SendSmsRequest re = new SendSmsRequest
            {
                TemplateCode = templateCode,
                RecNum       = recNum,
                ParamString  = paramString
            };

            var reslut = await Task.Run(() =>
            {
                return(ALiYunSMS.SendSMS(re));
            });

            return(reslut);
        }
Пример #4
0
        /// <summary>
        /// 异步
        /// </summary>
        /// <param name="templateCode">模版</param>
        /// <param name="liRecNum">电话集合</param>
        /// <param name="paramString">变量</param>
        /// <param name="signName">签名</param>
        /// <returns></returns>
        public static async Task <bool> SendSMMassAsync(string templateCode, List <string> liRecNum, Dictionary <string, string> paramString, string signName)
        {
            SendSmsRequest re = new SendSmsRequest
            {
                TemplateCode = templateCode,
                LiRecNum     = liRecNum,
                ParamString  = paramString,
                SignName     = signName
            };

            var reslut = await Task.Run(() =>
            {
                return(ALiYunSMS.SendSMS(re));
            });

            return(reslut);
        }