Exemple #1
0
        /// <summary>
        /// 发送短信
        /// </summary>
        /// <param name="tel">手机号码</param>
        /// <returns></returns>
        public static string SendSMSVoice(string tel, string Content)
        {
            string DLConfig  = Adpost.Common.ConfigModel.ConfigClass.GetConfigString("appSettings", "DLConfig");
            string SQMConfig = Adpost.Common.ConfigModel.ConfigClass.GetConfigString("appSettings", "SQMConfig");
            string voiceid   = DateTime.Now.ToString("yyyyMMddHHmmssfff");
            string pwd       = GetMD5(DLConfig + SQMConfig);

            //加密结果长度必须是32位的,不足32位,前面加0不足
            if (pwd.Length < 32)
            {
                for (int i = 0; i < 32 - pwd.Length; i++)
                {
                    pwd = "0" + pwd;
                }
            }

            Eyousoft_yhq.Web.net._2office.voicesms.VoiceVerificationService sns = new Eyousoft_yhq.Web.net._2office.voicesms.VoiceVerificationService();
            string[] ReValue = null;
            string   re      = sns.SendVoiceCode("2521149", pwd, "", tel, Content, voiceid, "1");

            ReValue = re.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            return(ReValue[0].ToString() == "0" ? "成功" : ReValue[1].ToString());
        }
Exemple #2
0
        /// <summary>
        /// 发送短信
        /// </summary>
        /// <param name="tel">手机号码</param>
        /// <returns></returns>
        public static string SendSMSVoice(string tel, string Content)
        {
            string DLConfig = Adpost.Common.ConfigModel.ConfigClass.GetConfigString("appSettings", "DLConfig");
            string SQMConfig = Adpost.Common.ConfigModel.ConfigClass.GetConfigString("appSettings", "SQMConfig");
            string voiceid = DateTime.Now.ToString("yyyyMMddHHmmssfff");
            string pwd = GetMD5(DLConfig + SQMConfig);
            //加密结果长度必须是32位的,不足32位,前面加0不足
            if (pwd.Length < 32)
            {
                for (int i = 0; i < 32 - pwd.Length; i++)
                {
                    pwd = "0" + pwd;
                }
            }

            Eyousoft_yhq.Web.net._2office.voicesms.VoiceVerificationService sns = new Eyousoft_yhq.Web.net._2office.voicesms.VoiceVerificationService();
            string[] ReValue = null;
            string re = sns.SendVoiceCode("2521149", pwd, "", tel, Content, voiceid, "1");
            ReValue = re.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            return ReValue[0].ToString() == "0" ? "成功" : ReValue[1].ToString();
        }