public static String getRandomStr(){
Random random=new Random(); String randString = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";//用于随机产生字符串 StringBuffer sb=new StringBuffer(); for(int i=0;i<6;i++){ String valueOf = String.valueOf(randString.charAt(random.nextInt(randString.length()))); String rand = String.valueOf(valueOf); sb.append(rand); } return sb.toString();}