atitit 短信验证码的源码实现  .docx

参考 Atitit usrQBM1603短信验证码规范1

主要方法1

源码实现1

参考 Atitit usrQBM1603短信验证码规范

主要方法

Line 27: public class SmsCaptchaService extends CaptchaService {

Line 36: public static void main(String[] args) {

Line 49: public static SmsCaptchaService buildAsYuntonsyon() {

Line 57: public static SmsCaptchaService buildAsSms1xinxi() {

Line 65: public Object send(String mobile) {

Line 86: public Object send(String mobile, String content) {

Line 103: public boolean check(String captcha) throws CapchCheckFailEx {

源码实现

package com.attilax.captcha;

import java.util.Set;

import javax.servlet.http.HttpSession;

import com.attilax.captcha.CaptchaService;

import com.attilax.corePkg.RandomX;

import com.attilax.json.AtiJson;

import com.attilax.lang.Global;

import com.attilax.net.requestImp;

import com.attilax.secury.AesV2q421;

import com.attilax.sms.Sms1xinxi;

import com.attilax.sms.SmsService;

import com.attilax.sms.SmsServiceYyuntongxunImp;

import com.attilax.web.sessionImp;

import com.csmy.my.center.util.RequestUtil;

import com.google.common.collect.Sets;

import com.google.inject.Inject;

/**

* com.attilax.sms.SmsCaptchaService

*

* @author Administrator

*

*/

public class SmsCaptchaService extends CaptchaService {

@Inject

CaptchaService captSvs;

@Inject

SmsService smsSrv;

// @Inject

RandomX rdmx = new RandomX();

public static void main(String[] args) {

// System.out.println( new SmsCaptchaService().send("18573344543",

// "xxcontent"));

requestImp ri=new requestImp();

sessionImp si=new sessionImp();

ri.setSession(si);

Global.req.set(ri);

SmsCaptchaService SmsCaptchaService1 = SmsCaptchaService.buildAsYuntonsyon();

//System.out.println(SmsCaptchaService1.send("18867311166" ));;

SmsCaptchaService1.send("18573344543" );

}

public static SmsCaptchaService buildAsYuntonsyon() {

SmsService smsS = new SmsServiceYyuntongxunImp();

SmsCaptchaService svs = new SmsCaptchaService();

svs.smsSrv = smsS;

return svs;

}

public static SmsCaptchaService buildAsSms1xinxi() {

SmsService smsS = new Sms1xinxi();

SmsCaptchaService svs = new SmsCaptchaService();

svs.smsSrv = smsS;

return svs;

}

public Object send(String mobile) {

String Capt= super.setCapt();

Object sendRzt = smsSrv.send(mobile, String.valueOf(Capt));

return sendRzt;

}

public Object send(String mobile, String content) {

int rdm = new RandomX().randomNum(1000, 9999);

content = content.replace("$capt$", String.valueOf(rdm));

// if(smsSrv==null)

//Sms1xinxi smsSrv = new Sms1xinxi();

Object send = smsSrv.send(mobile, content);

HttpSession session = Global.req.get().getSession();

Set<String> st = (Set<String>) session.getAttribute("captSet");

if (st == null)

st = Sets.newHashSet();

st.add(String.valueOf(rdm));

session.setAttribute("captSet", st);

session.setAttribute("capt", String.valueOf(rdm));

return send;

}

}

作者:: 绰号:老哇的爪子 ( 全名::Attilax Akbar Al Rapanui 阿提拉克斯 阿克巴 阿尔 拉帕努伊 )

汉字名:艾提拉(艾龙),   EMAIL:1466519819@qq.com

转载请注明来源: http://www.cnblogs.com/attilax/

Atiend

atitit 短信验证码的源码实现  .docx的更多相关文章

  1. atitit.短信 验证码  破解  v3 p34  识别 绕过 系统方案规划----业务相关方案 手机验证码  .doc

    atitit.短信 验证码  破解  v3 p34  识别 绕过 系统方案规划----业务相关方案 手机验证码  .doc 1. 手机短信验证码 vs 图片验证码 安全性(破解成本)确实要高一些1 1 ...

  2. 使用定时器限制点击按钮发送短信(附源码)--JavaScript小案例

    不说多哈,有注释哦,直接贴代码了哈,有疑问请追评呢…… 1.禁用按钮: this.disabled = "disabled"(this指按钮)或: this.disabled = ...

  3. Android之短信验证码

    我们今天所使用的方案仅仅是android手机设备集成短信验证码功能的方案之中的一个. 我们所採用的方案是使用聚合数据的短信验证sdk. 程序的界面例如以下所看到的: 实现步骤: 1.到聚合数据官网上申 ...

  4. Atitit. 破解  拦截 绕过 网站 手机 短信 验证码  方式 v2 attilax 总结

    Atitit. 破解  拦截 绕过 网站 手机 短信 验证码  方式 v2 attilax 总结 1. 验证码的前世今生11.1. 第一代验证码 图片验证码11.2. 第二代验证码  用户操作 ,比如 ...

  5. atitit.破解 拦截 绕过 网站 手机 短信 验证码 之自动获取手机短信方式 attilax 总结

    atitit.破解  拦截 绕过 网站 手机 短信 验证码 之自动获取手机短信方式 attilax 总结 1. 自动获取手机短信方式的原理 1 2. 调用api 1 3. ----核心代码 2 4.  ...

  6. Atitit usrQBM1603短信验证码规范

    Atitit usrQBM1603短信验证码规范 短信验证码扩展至短信服务和验证码服务1 主要方法1 参考模板1 短信验证码扩展至短信服务和验证码服务 主要方法 Line 27: public cla ...

  7. atitit 短信接口规范与短信解决方案.docx

    atitit 短信接口规范与短信解决方案.docx 1.1. 国内比较著名的短信提供商1 1.2. 短信接口规范1 1.3. 短信sdk构成1 1.4. 短信的实现1 1.5. SmsServiceY ...

  8. SpringBoot + Spring Security 学习笔记(五)实现短信验证码+登录功能

    在 Spring Security 中基于表单的认证模式,默认就是密码帐号登录认证,那么对于短信验证码+登录的方式,Spring Security 没有现成的接口可以使用,所以需要自己的封装一个类似的 ...

  9. Unity利用SMSSDK实现短信验证码(附代码)

    最近一直在研究如何给app更多实用性的功能,在app进行登录或者注册时,为了方便用户更加快捷的完成登录功能,所以就决定采用短信验证码的方式进行验证登录.在学习的过程中,先使用了Mob的短信服务进行短信 ...

随机推荐

  1. 闲来无事——第一弹 Java基础 基本数据类型

    一个优秀的Java类一定要去优质的名称,类的命名主要有字母和数字,并且必须以字母开头:虽然说没有明确规定类名首字母要大写,但是实际上如果出现首字母小写的类名,那就呵呵了,坐等挨骂吧!类名首字母大写是业 ...

  2. php安装libiconv-1.14.tar.gz遇到的问题

    遇到的Error code In file included from progname.c:26:0: ./stdio.h:1010:1: error: ‘gets‘ undeclared here ...

  3. [转]JUnit-4.11使用报java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing错误

    原文引自: http://blog.csdn.net/castle07/article/details/8553704 今天尝试使用JUnit,下载了最新的JUnit版本,是4.11,结果尝试使用发现 ...

  4. 那年有关 return ; 的一切

    现在只知道在dev C++里面声明了函数的返回类型不为void就不能写return; ,但是如果返回值为void就可以写return; ,而且如你所愿.

  5. Android密码约束规则例子一

    Android常用的一个密码规则 (一)密码必须是8至16位:(二)密码必须包含英文字母和数字:(三)密码不能包含4位连续相同的字符,如0000或AAAA:(四)密码不能包含4位连续递增或连续递减的数 ...

  6. mysql 函数(一)

    1.ascii() 查询ascii值,多个字符的情况下,显示左边第一个字符的ascii值 SELECT ASCII("abc"); 等同于 SELECT ASCII("a ...

  7. Sql Servicer 复习笔记(1) 存储过程分布

    第一步:创建表 declare @countInt int declare @age int ) begin ),@countInt), @age,'中国北京') ; ; ) begin ; end ...

  8. 精益VS六西格玛

    名称 精益方法 Six Sigma管理 假定 1)消除浪费可以改善绩效 2)大量的小改进更有利于组织成长 1)问题总是存在的: 2)测量是重要的: 3)随着变异减少,系统产出得到改进 文化基础 东方以 ...

  9. Mac 识别NTFS移动硬盘

    下载工具 TUXERA NTFS 2014

  10. C++ 非阻塞套接字的使用 (1)

    在维护代码的过程中,发现软件运行的CPU占用率居高不下,在4核的电脑上占用了25%的CPU.查阅资料的得知,这是可能是由于软件中出现了死循环. 经过对软件的一些测试,最终确定了死循环出现的位置——通讯 ...