短信验证码

http://www.xingnanriji.com/


  /// <summary>
        /// 验证码
        /// </summary>
        /// <param name="tel">手机号</param>
        /// <returns></returns>
        public string yzm(string tel, ref Dictionary<string, object> ht)
        {
            string res = "";
            #region
            //SmsClient client = new SmsClient();
            //string num = helpService.getYZM();
            json数据返回 
            //Dictionary<string, object> ret = client.SendSMS(tel, "验证码:" + num, "1234", "");//123456788990000


            //string code = ret["code"].ToString();


            //if (code == Constants.SUCCESS_CODE)
            //{
            //    res = "1";
            //    ht.Add("num", num);
            //}
            //else
            //{
            //    res = string.Format("发送失败:失败编码{0},{1}", ret["code"], ret["message"]);
            //}
            #endregion
            string num = helpService.getYZM();
            string data = "account=yw5764290&pwd=123789&product=15&mobile=" + tel + "&message=你好你的验证码是" + num + "【签名】";
            string bval = utility.HttpPost("http://dx.10659com.com:83/ApiService.asmx/Send", data);


            if (bval.IndexOf("200,") > -1)
            {
                res = "1";
                ht.Add("num", num);
            }
            else
            {
                string msg = "";
                if (bval.IndexOf("-100") > -1)
                {
                    msg = "账号或密码不合法";
                }
                else if (bval.IndexOf("-101") > -1)
                {
                    msg = "关键词不合法";
                }
                else if (bval.IndexOf("-102") > -1)
                {
                    msg = "产品不存在";
                }
                else if (bval.IndexOf("-103") > -1)
                {
                    msg = "数据包过长";
                }
                else if (bval.IndexOf("-104") > -1)
                {
                    msg = "数据包没号码或号码个数不足产品规定的最小阀值";
                }
                else if (bval.IndexOf("-105") > -1)
                {
                    msg = "内容长度错";
                }
                else if (bval.IndexOf("-106") > -1)
                {
                    msg = "无发送额度";
                }
                else if (bval.IndexOf("-107") > -1)
                {
                    msg = "系统维护中";
                }
                else if (bval.IndexOf("-108") > -1)
                {
                    msg = "未知错误中";
                }
                else
                {
                    msg = "未知错误中2";
                }
                res = string.Format("发送失败:{0}", msg);
            }
            return res;
        }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值