如果是 java 类的话
建议 每次把错误的值保存在Application 或 Session 中
然后取出来
每错一次 就+1
到了5 次 就不能操作了如果是js 的话
建议用递归算法// session
if(session.getAttribute("sessionCount") == null ){
session.setAttribute("sessionCount",new Integer(1) );
}else{
Integer count2 = (Integer)session.getAttribute("sessionCount");
session.setAttribute("sessionCount",new Integer(count2.intValue() + 1));
}
out.println("sessionCount:" + session.getAttribute("sessionCount")+"<br>");
//application
if(application.getAttribute("applicationCount") == null){
application.setAttribute("applicationCount",new Integer(1));
}else{
Integer count3 = (Integer)application.getAttribute("applicationCount");
application.setAttribute("applicationCount",new Integer(count3.intValue() + 1));
}兄弟 希望对你有帮助
^_*
建议 每次把错误的值保存在Application 或 Session 中
然后取出来
每错一次 就+1
到了5 次 就不能操作了如果是js 的话
建议用递归算法// session
if(session.getAttribute("sessionCount") == null ){
session.setAttribute("sessionCount",new Integer(1) );
}else{
Integer count2 = (Integer)session.getAttribute("sessionCount");
session.setAttribute("sessionCount",new Integer(count2.intValue() + 1));
}
out.println("sessionCount:" + session.getAttribute("sessionCount")+"<br>");
//application
if(application.getAttribute("applicationCount") == null){
application.setAttribute("applicationCount",new Integer(1));
}else{
Integer count3 = (Integer)application.getAttribute("applicationCount");
application.setAttribute("applicationCount",new Integer(count3.intValue() + 1));
}兄弟 希望对你有帮助
^_*
在执行语句前判断下
if(count<5)
{
..........
}
就能实现你想要的功能了