//------------------------------------------------------------------------------------------------------
生成四位随即验证码
String str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
StringBuilder s = new StringBuilder();
int len = 4;
for(int i=0;i<=len;i++){
Random r = new Random();
int p = r.nextInt(str.length());
s.append(str.charAt(p));
}
System.out.println(s.toString());
//------------------------------------------------------------------------------------------------------
时间: 2024-10-14 10:47:58