// 获取验证码
public String test() {
String str = "CanDeEbFdG7OHIcJoQ5prPWsfghi6Vjkqlm18tuRS3LTUvwNxyzABK2M4XYZ9";
Random in = new Random();
char[] ch = new char[4];
for (int x = 0; x < ch.length; x++) {
int index = in.nextInt(str.length());
ch[x] = str.charAt(index);
}
String s=new String(ch);
return s;
}
public boolean compear(String s,String s1){
return s.equals(s1);
}
|