一个比较完整的短信接口帮助类参考

最近在做一个学校短信项目,使用了第三方提供的短信接口,现将本次封装好的短信接口帮助类分享一下:

下面是发送界面,还未美化完,支持学校各种形式的短信发送功能。

下面是封装好的方法,支持余额查询,批量发送等多种功能。

    /// <summary>
    /// 短信接口帮助类
    ///
    ///
    /// 修改纪录
    ///
    /// 2016-07-02 版本:1.0 SongBiao 创建文件。
    ///
    /// <author>
    ///     <name>SongBiao</name>
    ///     <date>2016-07-02</date>
    /// </author>
    /// </summary>

    public class MobilleMessageHelper
    {
        /// <summary>
        /// 短信服务地址
        /// </summary>
        const string Url = "http://XXXX.com/api/MsgSend.asmx";
        /// <summary>
        /// 短信账号
        /// </summary>
        const string UserCode = "xxxxx";
        /// <summary>
        /// 短信密码
        /// </summary>
        const string UserPass = "yyyyy";
        /// <summary>
        /// 签名
        /// </summary>
        public const string Signature = "【宜宾鸿辉】";
        /// <summary>
        /// 通道号
        /// </summary>
        const string  Channel="178";
        /// <summary>
        /// 扩展号
        /// </summary>
        const string  ExeNo="扩展号";

        #region http 请求及加密
        /// <summary>
        /// http get请求
        /// </summary>
        /// <param name="url"></param>
        /// <param name="data"></param>
        /// <returns></returns>
        public static string HttpGet(string url, string data)
        {
            try
            {
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url + "?" + data);
                request.Method = "GET";
                request.ContentType = "text/html;charset=UTF-8";
                HttpWebResponse response = (HttpWebResponse)request.GetResponse();
                Stream myResponseStream = response.GetResponseStream();
                StreamReader myStreamReader = new StreamReader(myResponseStream, Encoding.GetEncoding("utf-8"));
                string retString = myStreamReader.ReadToEnd();
                myStreamReader.Close();
                myResponseStream.Close();
                return retString;
            }
            catch (Exception ex)
            {
                return ex.Message;
            }
        }

        /// <summary>
        ///  http post请求
        /// </summary>
        /// <param name="url"></param>
        /// <param name="data"></param>
        /// <returns></returns>
        public static string HttpPost(string url, string data)
        {
            try
            {
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
                request.Method = "POST";
                request.ContentType = "application/x-www-form-urlencoded";
                byte[] info = Encoding.UTF8.GetBytes(data);
                using (Stream stream = request.GetRequestStream())
                {
                    stream.Write(info, 0, info.Length);
                }
                HttpWebResponse response = (HttpWebResponse)request.GetResponse();
                Stream myResponseStream = response.GetResponseStream();
                StreamReader myStreamReader = new StreamReader(myResponseStream, Encoding.GetEncoding("utf-8"));
                string retString = myStreamReader.ReadToEnd();
                myStreamReader.Close();
                myResponseStream.Close();
                return retString;
            }
            catch (Exception ex)
            {
                return ex.Message;
            }
        }

        /// <summary>
        /// DES加密
        /// </summary>
        /// <param name="str"></param>
        /// <param name="key"></param>
        /// <returns></returns>
        public static string EncodeStr(string str, string key)
        {
            try
            {
                DESCryptoServiceProvider provider = new DESCryptoServiceProvider();
                provider.Key = Encoding.ASCII.GetBytes(key.Substring(0, 8));
                provider.IV = Encoding.ASCII.GetBytes(key.Substring(0, 8));
                byte[] bytes = Encoding.GetEncoding("GB2312").GetBytes(str);
                MemoryStream stream = new MemoryStream();
                CryptoStream stream2 = new CryptoStream(stream, provider.CreateEncryptor(), CryptoStreamMode.Write);
                stream2.Write(bytes, 0, bytes.Length);
                stream2.FlushFinalBlock();
                StringBuilder builder = new StringBuilder();
                foreach (byte num in stream.ToArray())
                {
                    builder.AppendFormat("{0:X2}", num);
                }
                stream.Close();
                return builder.ToString();
            }
            catch (Exception ex)
            {
                return ex.Message;
            }
        }

        /// <summary>
        /// //SHA1加密
        /// </summary>
        /// <param name="strSha1In"></param>
        /// <returns></returns>
        public static string SHA1Hash(string strSha1In)
        {
            SHA1 sha1 = new SHA1CryptoServiceProvider();
            byte[] bytesSha1In = UTF8Encoding.Default.GetBytes(strSha1In);
            byte[] bytesSha1Out = sha1.ComputeHash(bytesSha1In);
            string strSha1Out = BitConverter.ToString(bytesSha1Out);
            strSha1Out = strSha1Out.Replace("-", "");
            return strSha1Out;
        }

        #endregion

        /*
        返回值类型
        string
        成功返回值
        返回用户金额的数字
        失败返回值
        返回带负号的失败代码
         */

        #region 余额查询
        /// <summary>
        /// POST方式请求 余额查询
        /// </summary>
        /// <returns></returns>
        public static string GetBalanceByPost()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("userCode="+UserCode+"&");
            sb.Append("userPass="+UserPass);

            string result = HttpPost(Url + "/GetBalance", sb.ToString());
            return result;
        }

        /// <summary>
        /// Get方式请求 余额查询
        /// </summary>
        /// <returns></returns>
        public static string GetBalanceByGet()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("userCode="+UserCode+"&");
            sb.Append("userPass="+UserPass);

            string result = HttpGet(Url + "/GetBalance", sb.ToString());
            return result;
        }

        //private void getbalance()
        //{
        //    TopenServiceReference.MsgSendSoapClient topen = new TopenServiceReference.MsgSendSoapClient();
        //    string userName = "用户名";
        //    string passWord = "密码";
        //    string sendResult = topen.GetBalance(userName, passWord);

        //    //然后,根据返回的sendResult作相应处理
        //}
        #endregion

        /*
        返回值类型
        string
        成功返回值
        返回本次提交的批次号(如:2114355899380234221),(或叫序列号、流水号等,提交一次返回一个)
        失败返回值
        返回带负号的失败代码
        */
        #region 短信发送
        /// <summary>
        /// POST方式请求 短信发送 手机号码,多个号码用英文半角逗号分隔例如:13900000000,13900000001每次提交不多于500个号码
        /// </summary>
        /// <param name="desNo"></param>
        /// <param name="msg"></param>
        /// <returns>返回本次提交的批次号(如:2114355899380234221),(或叫序列号、流水号等,提交一次返回一个) ;失败返回值 返回带负号的失败代码</returns>
        public static string SendMsgByPost(string desNo, string msg)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("userCode="+UserCode+"&");
            sb.Append("userPass="+UserPass+"&");
            sb.Append("DesNo="+desNo+"&");
            sb.Append("Msg="+msg+Signature+"&");
            sb.Append("Channel="+Channel);

            string result = HttpPost(Url + "/sendMes", sb.ToString());
            return result;
        }

        /// <summary>
        /// Get方式请求 短信发送 手机号码,多个号码用英文半角逗号分隔例如:13900000000,13900000001每次提交不多于500个号码
        /// </summary>
        /// <param name="desNo"></param>
        /// <param name="msg"></param>
        /// <returns>返回本次提交的批次号(如:2114355899380234221),(或叫序列号、流水号等,提交一次返回一个) ;失败返回值 返回带负号的失败代码</returns>
        public static string SendMsgByGet(string desNo, string msg)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("userCode="+UserCode+"&");
            sb.Append("userPass="+UserPass+"&");
            sb.Append("DesNo="+desNo+"&");
            sb.Append("Msg="+msg+Signature+"&");
            sb.Append("Channel="+Channel);

            string result = HttpGet(Url + "/sendMes", sb.ToString());
            return result;
        }

        /// <summary>
        /// /POST方式请求 加密短信发送 手机号码,多个号码用英文半角逗号分隔例如:13900000000,13900000001每次提交不多于500个号码
        /// </summary>
        /// <param name="desNo"></param>
        /// <param name="msg"></param>
        /// <returns>返回本次提交的批次号(如:2114355899380234221),(或叫序列号、流水号等,提交一次返回一个) ;失败返回值 返回带负号的失败代码</returns>
        public static string SendMsgEncryptByPost(string desNo, string msg)
        {
            string encryptCode =
                EncodeStr(
                    "userPass=" + UserPass + "&DesNo=" + desNo + "&Msg=" + msg + Signature + "&Channel=" + Channel,
                    SHA1Hash(UserPass));
            StringBuilder sb = new StringBuilder();
            sb.Append("userCode="+UserCode+"&");
            sb.Append("submitInfo="+encryptCode);
            string result = HttpPost(Url + "/sendMsgByEncrypt", sb.ToString());

            return result;
        }

        /// <summary>
        /// Get方式请求 加密短信发送 手机号码,多个号码用英文半角逗号分隔例如:13900000000,13900000001每次提交不多于500个号码
        /// </summary>
        /// <param name="desNo"></param>
        /// <param name="msg"></param>
        /// <returns>返回本次提交的批次号(如:2114355899380234221),(或叫序列号、流水号等,提交一次返回一个) ;失败返回值 返回带负号的失败代码</returns>
        public static string SendMsgEncryptByGet(string desNo, string msg)
        {
            string encryptCode=EncodeStr("userPass="+UserPass+"&DesNo="+desNo+"&Msg="+msg+Signature+"&Channel="+Channel,SHA1Hash(UserPass));
            StringBuilder sb = new StringBuilder();
            sb.Append("userCode="+UserCode+"&");
            sb.Append("submitInfo="+encryptCode);
            string result = HttpGet(Url + "/sendMsgByEncrypt", sb.ToString());

            return result;
        }

        /// <summary>
        ///  POST方式请求 个性化短信发送
        /// 例如,需发送如下短信
        /// 13800000000 王某某,明天记得要开会【123】
        /// 13800000000 张某某,明天记得要开会【123】
        /// 13800000000 李某某,明天记得要开会【123】
        /// 最终拼接url如下:http://yes.itissm.com/api/IndividualSm.aspx?account=admin1&pwd=123&channel=37&msg=13800000000|!|王某某,明天记得要开会【123】|^|13900000000|!|张某某,明天记得要开会【123】|^|18600000000|!|李某某,明天记得要开会【123】
        /// </summary>
        /// <param name="msg">短信内容为utf-8编码每条个性化短信以英文|^|分割,号码与短信内容以英文|!|分割</param>
        /// <returns>返回本次提交的批次号(如:2114355899380234221),(或叫序列号、流水号等,提交一次返回一个) ;失败返回值 返回带负号的失败代码</returns>
        public static string IndividUalsmByPost(string msg)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("account="+UserCode+"&");
            sb.Append("pwd="+UserPass+"&");
            sb.Append("Channel="+Channel+"&");
            //sb.Append("Msg=手机号|!|短信内容【签名】|^|手机号|!|短信内容【签名】|^|");
            sb.Append("Msg="+msg);

            string result = HttpPost(Url,sb.ToString());
            return result;
        }

        //private void SendSms() //webservice请求方式
        //{
        //    TopenServiceReference.MsgSendSoapClient topen = new TopenServiceReference.MsgSendSoapClient();
        //    string userName = "用户名";
        //    string passWord = "密码";
        //    string mobiles = "13900000000,13800000000,13100000000,……";
        //    string msgContent = "短信内容(含签名)";
        //    string channel = "由拓鹏给您的通道编号";
        //    string sendResult = topen.sendMes(userName, passWord, mobiles, msgContent, channel); //此处的sendMes可能因接口文档不同而不同,请注意。返回批次号,可保存下来,作为获取发送报告凭据

        //    //然后,根据返回的sendResult作相应处理
        //}
        #endregion

        #region 短信扩展发送
        /// <summary>
        ///  POST方式请求 短信扩展发送
        /// </summary>
        /// <returns></returns>
        public static string SendMsgExtByPost(string desNo,string msg)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("userCode="+UserCode+"&");
            sb.Append("userPass="+UserPass+"&");
            sb.Append("DesNo="+desNo+"&");
            sb.Append("Msg="+msg+Signature+"&");
            sb.Append("Channel="+Channel+"&");
            sb.Append("ExeNo="+ExeNo);
            string result = HttpPost(Url + "/sendMesExt", sb.ToString());
            return result;
        }

        /// <summary>
        ///  Get方式请求 短信扩展发送
        /// </summary>
        /// <returns></returns>
        public static string SendMsgExtByGet(string desNo,string msg)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("userCode="+UserCode+"&");
            sb.Append("userPass="+UserPass+"&");
            sb.Append("DesNo="+desNo+"&");
            sb.Append("Msg="+msg+Signature+"&");
            sb.Append("Channel="+Channel+"&");
            sb.Append("ExeNo="+ExeNo);
            string result = HttpGet(Url + "/sendMesExt", sb.ToString());
            return result;
        }
        #endregion

        #region 获取状态报告
        /// <summary>
        ///  POST方式请求 获取状态报告
        /// </summary>
        /// <returns></returns>
        public static string GetReport2ByPost()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("userCode="+UserCode+"&");
            sb.Append("userPass="+UserPass);

            string result = HttpPost(Url + "/GetReport2", sb.ToString());
            return result;
        }

        /// <summary>
        ///  Get方式请求 获取状态报告
        /// </summary>
        /// <returns></returns>
        public static string GetReport2ByGet()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("userCode="+UserCode+"&");
            sb.Append("userPass="+UserPass);

            string result = HttpGet(Url + "/GetReport2", sb.ToString());
            return result;
        } 

        /// <summary>
        /// POST方式请求加密 获取状态报告
        /// </summary>
        /// <returns></returns>
        public static string GetReport2EncryptByPost()
        {
            string encryptCode=EncodeStr("userPass="+UserPass,SHA1Hash(UserPass));
            StringBuilder sb = new StringBuilder();
            sb.Append("userCode="+UserCode+"&");
            sb.Append("submitInfo="+encryptCode);

            string result = HttpPost(Url + "/GetReport2ByEncrypt", sb.ToString());

            return result;
        }

        /// <summary>
        /// Get方式请求加密 获取状态报告
        /// </summary>
        /// <returns></returns>
        public static string GetReport2EncryptByGet()
        {
            string encryptCode=EncodeStr("userPass="+UserPass,SHA1Hash(UserPass));
            StringBuilder sb = new StringBuilder();
            sb.Append("userCode="+UserCode+"&");
            sb.Append("submitInfo="+encryptCode);

            string result = HttpGet(Url + "/GetReport2ByEncrypt", sb.ToString());
            return result;
        }
        #endregion

        #region 获取回复
        /// <summary>
        /// POST方式请求 获取回复
        /// </summary>
        /// <returns></returns>
        public static string GetMo2ByPost()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("userCode="+UserCode+"&");
            sb.Append("userPass="+UserPass);
            string result = HttpPost(Url + "/GetMo2", sb.ToString());
            return result;
        }

        /// <summary>
        ///  Get方式请求 获取回复
        /// </summary>
        /// <returns></returns>
        public static string GetMo2ByGet()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("userCode="+UserCode+"&");
            sb.Append("userPass="+UserPass+"&");
            string result = HttpGet(Url + "/GetMo2", sb.ToString());
            return result;
        }
        /// <summary>
        /// POST方式请求 获取回复(加密)
        /// </summary>
        /// <returns></returns>
        public static string GetMo2EncryptByPost()
        {
            string encryptCode=EncodeStr("userPass="+UserPass,SHA1Hash(UserPass));
            StringBuilder sb = new StringBuilder();
            sb.Append("userCode="+UserCode+"&");
            sb.Append("submitInfo="+encryptCode);
            string result = HttpPost(Url + "/GetMo2ByEncrypt", sb.ToString());
            return result;
        }
        /// <summary>
        /// Get方式请求 获取回复(加密)
        /// </summary>
        /// <returns></returns>
        public static string GetMo2EncryptByGet()
        {
            string encryptCode = EncodeStr("userPass=密码", SHA1Hash(UserPass));
            StringBuilder sb = new StringBuilder();
            sb.Append("userCode="+UserCode+"&");
            sb.Append("submitInfo="+encryptCode);
            string result = HttpGet(Url + "/GetMo2ByEncrypt", sb.ToString());
            return result;
        }
        #endregion

        #region 获取关键字
        /// <summary>
        ///  POST方式请求 获取关键字
        /// </summary>
        /// <returns></returns>
        public static string GetKeywordsByPost()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("userCode="+UserCode+"&");
            sb.Append("userPass="+UserPass+"&");
            sb.Append("Channel="+Channel);
            string result = HttpPost(Url + "/GetKeyWords", sb.ToString());
            return result;
        }

        /// <summary>
        /// Get方式请求 获取关键字
        /// </summary>
        /// <returns></returns>
        public static string GetKeywordsByGet()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("userCode="+UserCode+"&");
            sb.Append("userPass="+UserPass+"&");
            sb.Append("Channel="+Channel);
            string result = HttpGet(Url + "/GetKeyWords", sb.ToString());
            return result;
        }
        #endregion

    }

    /// <summary>
    /// 手机短信 云信状态枚举
    /// </summary>
    public enum YunXinMessageStatus
    {
        /// <summary>
        /// -1 应用程序异常
        /// </summary>
        [EnumDescription("应用程序异常")]
        ApplicationError = -1,

        /// <summary>
        ///  -3 用户名密码错误或者用户无效
        /// </summary>
        [EnumDescription("用户名密码错误或者用户无效")]
        AccountError = -3,

        /// <summary>
        ///  -5 签名不正确(格式为:XXX【签名内容】), 注意:短信内容最后一个字符必须是】
        /// </summary>
        [EnumDescription("签名不正确")]
        SignatureError = -5,

        /// <summary>
        ///  -6:keyWords 含有关键字keyWords(keyWords为敏感内容,如:-6:促销)
        /// </summary>
        [EnumDescription("含有关键字")]
        KeyWordsNotAllow = -6,

        /// <summary>
        ///  -7 余额不足
        /// </summary>
        [EnumDescription("余额不足")]
        BalanceNotEnough = -7,

        /// <summary>
        ///   -8 没有可用的通道,或不在时间范围内
        /// </summary>
        [EnumDescription("余额不足")]
        ChannelNoAvailable = -8,

        /// <summary>
        ///  -9 发送号码一次不能超过1000个
        /// </summary>
        [EnumDescription("发送号码一次不能超过1000个")]
        SendTooManyNumbers = -9,

        /// <summary>
        ///  -10 号码数量大于允许上限(不设置上限时,不可超过1000)
        /// </summary>
        [EnumDescription("号码数量大于允许上限(不设置上限时,不可超过1000)")]
        SendOverLimit = -10,

        /// <summary>
        ///  -11 号码数量小于允许下限
        /// </summary>
        [EnumDescription("号码数量小于允许下限")]
        SendLessLimit = -11,

        /// <summary>
        ///  -12 模板不匹配
        /// </summary>
        [EnumDescription("模板不匹配")]
        TemplateMismatch = -12,

        /// <summary>
        ///  -13 Invalid Ip ip绑定用户,未绑定该ip
        /// </summary>
        [EnumDescription("ip绑定用户,未绑定该ip")]
        InvalidIp = -13,

        /// <summary>
        ///  -14 用户黑名单
        /// </summary>
        [EnumDescription("用户黑名单")]
        UserBlackList = -14,

        /// <summary>
        ///  -15 系统黑名单
        /// </summary>
        [EnumDescription("系统黑名单")]
        SystemBlackList = -15,

        /// <summary>
        ///  -16 号码格式错误
        /// </summary>
        [EnumDescription("号码格式错误")]
        NumberFormatError = -16,

        /// <summary>
        ///  -17 无效号码(格式正常,可不是正确的电话号码,如12345456765)
        /// </summary>
        [EnumDescription("无效号码")]
        InvalidNumber = -17,

        /// <summary>
        /// -18 没有设置用户的固定下发扩展,不能自定义扩展
        /// </summary>
        [EnumDescription("没有设置用户的固定下发扩展,不能自定义扩展")]
        CannotCustomizeExtension = -18,

        /// <summary>
        /// -19 强制模板通道,不能使用个性化接口
        /// </summary>
        [EnumDescription("强制模板通道,不能使用个性化接口")]
        CanNotUsePersonalized = -19,

        /// <summary>
        /// -20 包含非法字符
        /// </summary>
        [EnumDescription("包含非法字符")]
        ContainsIllegalCharacters = -20,

        /// <summary>
        /// -21 没有找到对应的submitID设置
        /// </summary>
        [EnumDescription("没有找到对应的submitID设置")]
        NoSubmitID = -21,

        /// <summary>
        /// -22 解密失败
        /// </summary>
        [EnumDescription("解密失败")]
        DecryptionFailure = -22,

        /// <summary>
        /// -23 查询余额过频繁(至少间隔10秒)
        /// </summary>
        [EnumDescription("查询余额过频繁(至少间隔10秒)")]
        QueryBalanceTooFrequent = -23,

    }
时间: 2025-01-10 04:32:11

一个比较完整的短信接口帮助类参考的相关文章

阿里大鱼短信接口

阿里大于短信验证实现完整代码分享 http://bbs.2ccc.com/topic.asp?topicid=515649 补充:跨平台的例子可以去csdn下载这位大神的demo http://download.csdn.net/detail/hansxia888/9603061 1 这两天搞那个sign,搞的烦躁,问了一下论坛的那位同学,开口500. 2 唉,delphi这种偏门的就是这样,啥都贵. 3 后来想想用C#按阿里那边的帮助文档写了个,可以正常发送.然后把C#翻译成Delphi就可以

如何防范短信接口被恶意调用(被刷)(转)

本文转自:https://zhuanlan.zhihu.com/p/20879468 一.什么是短信轰炸(短信接口被刷) 短信轰炸一般基于 WEB 方式(基于客户端方式的原理与之类似),由两个模块组成,包括:一个前端 Web 网页,提供输入被攻击者手机号码的表单:一个后台攻击页面(如 PHP),利用从各个网站上找到的动态短信 URL 和 前端输入的被攻击者手机号码,发送 HTTP 请求,每次请求给用户发送一个动态短信. - 被攻击者大量接收非自身请求的短信,造成无法正常使用移动运营商业务.- 短

tp5短信接口的使用

阿里大鱼短信配置非常简单,只需引入阿里大鱼完整SDK,然后在自己的项目里面引用SDK目录autoload.php文件,然后在接口调用demo接口就好了! 一,先说具体实现方法,最后附加源码包! 1.下载SDK,接口在阿里大鱼官网,本人使用版本为2017年10月下载,不保证后续官方SDK会相同,本人SDK版本地址百度云:http://pan.baidu.com/s/1eRPzmro 密码:oy7c:下载后放到TP5扩展目录extend下,如图: 2,仿照SDK的demo,编写自己的短信发送接口,这

关于手机短信接口优化

项目:目前需要支持手机号码注册,流程如下: 1)用户输入手机号码 2)点击获取手机校验码 3)收到短信息后,填入验证码.完成注册 有个问题,在项目中前期设计问题,导致短信接口被恶意调用. 调整方案: 网络提供方案: 推荐的对接方式:1.流程限定--将手机短信验证和用户名密码设置分成两个步骤,用户在注册成功用户名密码后,下一步才进行手机短信验证.(推荐)2.绑定图型校验码--将图形校验码和手机验证码进行绑定,这样能比较有效的防止软件恶意点击.(推荐) 不推荐的对接方式:3.短信发送间隔设置--设置

短信接口调用——阿里大于API开发心得

互联网上有许多公司提供短信接口服务,诸如网易云信.阿里大于等等.我在自己项目里需要使用到短信服务起到通知作用,实际开发周期三天,完成配置.开发和使用,总的说,阿里大于提供的接口易于开发,非常的方便,短信费用是计数缴纳的,作为个人开发者,我使用的服务产生的费用为0.45¥/条(10万条以下). 现在要实现一个例会短信群发通知的功能,所有被通知对象信息均存于Mysql中,应用架构采用asp.net MVC .首先准备好获取的API各项(以下各项服务参数都需要在大于官网上申请), 申请好自己的短信签名

zabbix短信接口调用出现的问题

在写调用短信网关的shell脚本的时候,发现了一个百思不得其解的问题,用浏览器访问短信接口地址是可以成功接收到短信的.但在shell 里面调用就报错了!!!在反复测试当中发现,在shell 中对特殊字符有特殊意义,这里需要把http整个部分用双引号括起来,问题就迎刃而解了.这里分享下,希望能帮助到有用短信网关出错的人

如何选择一家好的验证码短信接口服务商?

多年的行业经验及与客户沟通中所了解的一些信息反馈.现在总结出来 跟大家说一说,怎样去选择一家比较好的短信接口提供商. 公司网站/app想嵌入短信接口 发验证短信.去网上一搜几十家,每个网站的产品宣传.介绍都大同小异,挑了几家问问价格低至3,4分,高至7,8分.价格高的会说是验证码专用通道,但又去问问价格低的 也说是专用 这时在没使用过的情况下 价格低的完全占绝对优势 因为70%客户会选择价格便宜的.于是乎就开了帐号 充值使用了,用了3天,一个礼拜或者1-2个月 渐渐的问题开始多了,收不到 延迟厉

阿利大于短信接口问题

include "TopSdk.php";  function sendSMF ($mobile, $content ,$name) {    // include "TopSdk.php";  //错误在这里     date_default_timezone_set('Asia/Shanghai');           $c = new TopClient;     $c->appkey = '';     $c->secretKey = &quo

短信接口接近我们的生活

随着社会的发展,时代的进步,我们的生活水平已经得到了很大的提高,我们对生活的享受有了更大最求,我们所希望的就是方便,简洁.由于当今社会的种种压力,让我们不得不努力向前,我们不是机器,我们也会累的,所以在别的方面,我们希望尽可能的简单一些.发短信肯定是我们生活中不了缺少的一个部分,不管在什么时候只要动一动手指就可以轻松将想要说的话传达给对方.华软通信短信接口就是基于短信平台产生的,用于对短信的管理和传达. 短信接口是对你发的短信的管理,是短信平台的必须的系统.现代的网络短信平台也是传统的短信平台进