生成随机数验证码

1
2
3
4
5
6
7
String[] strArray = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
int codeCount = 4;
StringBuffer code = new StringBuffer();
for(int i=0; i<codeCount; i++) {
  code.append(strArray[(int) (Math.random()*10)]);
}
System.out.println(code);
posted @   Yuan丶野幻想  阅读(242)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示