jzsmx201506-1.0.0.jar实现周短信

来源:互联网 发布:中介软件哪个好 编辑:程序博客网 时间:2024/06/07 23:42


1.开源jar:jzsmx201506-1.0.0.jar
2.主程序:
//phoneNum:1352048546*
//messageStr:632577(注册),如不是本人操作,请忽略此消息。
public int InfoSend(String phoneNum,String messageStr) {

phoneNum = (phoneNum != null) ? phoneNum.trim() : "";
messageStr = (messageStr != null) ? messageStr.trim() : "";
if(phoneNum.equals("") || messageStr.equals("")) {
return 0;
}

//建周短信,70609:
try {
BusinessService bs = new BusinessService();
bs.setWebService("http://www.jianzhou.sh.cn/JianzhouSMSWSServer/services/BusinessService");
long resid = bs.sendBatchMessage("sdk_WPjinfu357", "39754876", phoneNum, messageStr+"【利易达】");
logger.info("***(theuser)建周短信连接,手机号["+phoneNum+"],发送返回结果="+resid);
if(resid > 0) {
return 1;
}
}catch(Exception e) {
logger.info("***(theuser)建周短信连接,Error:"+e.toString());
}
return 0;
}
3.六位验证码:
系统通过随机数生成.并在发送成功之后,将该数据写入数据库,便于下次验证.
//验证在1分钟之内是否已发送过短信:
//判断上一次发送时间是否在一小时之内:
//一小时内同一手机号限定5次:



<div class="frm_item">
<input type="text" name="umobile" id="iumobile" class="frm_txt" maxlength="11" placeholder="手机号码" value="" />
<input type="password" name="loginPwd" id="iloginPwd" maxlength="20" class="frm_txt" id="tx" placeholder="密码" value="" />
<input type="text" name="dxmessage" id="idxmsg" class="frm_txt frm_txt1" maxlength="6" placeholder="输入手机验证码" value="" />
<input type="button" id="idxnum" class="gain_btn" value="获取验证码" onclick="SendDxNum()" />
<input type="checkbox" id="iyxcheckbox" class="check" checked />
<span class="agree">我已阅读并同意<a href="${Constants.web_zx}/user/agreement_liyida.htm" target="_blank">《利易达网络服务使用协议》</a></span>
<input type="button" class="sub_btn" value="点击注册" placeholder="" onclick="reSub()" />


//发送短信:
function SendDxNum() {
if(sdtime == 60) {

theDwr.SetRegMsgNum(sjnum,
{
     callback:function(data) {
if(data == "ok") {

alert("温馨提示:短信验证码已发送,请注意查收,感谢您的使用!");
TimeShow();
}else if(data == "okend") {

alert("温馨提示:该手机号已被使用,请更换!");
}else if(data == "onein") {

alert("温馨提示:短信验证码已发送,一分钟之内请勿重复点击!");
TimeShow();
}else if(data == "fiveci") {

alert("温馨提示:该手机号在一小时内已发送过5次验证码,请稍后再试!");
}else {
alert("温馨提示:系统忙,请稍后重试,感谢您的使用!");
TimeShow();
}
 }
});
}
}





























原创粉丝点击