C# 手机验证码发送

实现C#手机验证码发送平台

给大家推荐 互亿无线 可以通过互亿无线实现C#手机号短信认证,注册时免费赠送10条免费发送。

实现短信发送步骤

1、发送验证码接口

public static string PostUrl = "http://106.ihuyi.com/webservice/sms.php?method=Submit";
        public Result Page_Load(string phone)
        {
            var redisphone = cs.Get(phone);
            if(redisphone!=null)
            {
                return new Result() { code = 100, msg = "操作频繁请稍后操作" };
            }


            string account = "C02210748";//查看用户名 登录用户中心->验证码通知短信>产品总览->API接口信息->APIID
            string password = "c03c675e60f24f1aef67979d737a61dd"; //查看密码 登录用户中心->验证码通知短信>产品总览->API接口信息->APIKEY
            string mobile = phone;
            //string mobile = Request.QueryString["mobile"];
            Random rad = new Random();
            int mobile_code = rad.Next(100000, 1000000);
            string content = "您的验证码是:" + mobile_code + " 。请不要把验证码泄露给其他人。";

            //Session["mobile"] = mobile;
            //Session["mobile_code"] = mobile_code;

            string postStrTpl = "account={0}&password={1}&mobile={2}&content={3}";//用户名+密码+注册的手机号+验证码

            UTF8Encoding encoding = new UTF8Encoding();
            byte[] postData = encoding.GetBytes(string.Format(postStrTpl, account, password, mobile, 
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值