Java.Utils得到并验证4位数的验证码(没看懂,有待研究)

来源:互联网 发布:java基础环境搭建 编辑:程序博客网 时间:2024/05/22 15:26
package com.oxcoder.checkdemo;

public class CheckGetUtil{
/*获得4个验证码数字*/
public static int [] getCheckNum(){
int [] tempCheckNum = {0,0,0,0};
for(int i = 0; i < 4; i++){
          tempCheckNum[i] = (int) (Math.random() * 10);
}
return tempCheckNum;
}
/*获得线的起止坐标*/
public static int[] getLine(int height, int width){
int [] tempCheckNum = {0,0,0,0};
for(int i = 0; i < 4; i+=2){
tempCheckNum[i] = (int) (Math.random() * width);
tempCheckNum[i + 1] = (int) (Math.random() * height);
}
return tempCheckNum;
}
/*获得点的圆心坐标*/
public static int[] getPoint(int height, int width){
int [] tempCheckNum = {0,0,0,0};
tempCheckNum[0] = (int) (Math.random() * width);
tempCheckNum[1] = (int) (Math.random() * height);
return tempCheckNum;
}
public static boolean checkNum(String userCheck, int[] checkNum){
//实现验证验证码是否正确,正确返回ture
if()
 

}
/*获取验证码的绘制位置*/
public static int getPositon(int height){
int tempPositoin = (int) (Math.random() * height);
if(tempPositoin < 15){
tempPositoin += 15;
}
return tempPositoin;
}
}
原创粉丝点击