实现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, co