码迷,mamicode.com
首页 > 其他好文 > 详细

不重复验证码

时间:2015-11-16 12:26:04      阅读:195      评论:0      收藏:0      [点我收藏+]

标签:

技术分享
 1 string s ="1234567890zxcvbnmasdfghjklqwertyuiopZXCVBNMASDFGHJKLQWERTYUIOP";
 2 string str="";
 3 Radom rand =new Random();//初始化随机数
 4 string[]arr=new string[4];
 5 for (int i=0;i<4;i++)?
 6 {
 7 arr[i] =rand.Next(62);//生成一个随机数的起始位置
 8 int cont=0;
 9 if(i>0)
10 {
11 for(int j=0;j<i;j++)
12 {
13 if(arr[i]==arr[j])
14 {
15 count++;
16 }
17 }
18 }
19 if(count>0)
20 {
21 i--;
22 continue;
23 }
View Code

 

不重复验证码

标签:

原文地址:http://www.cnblogs.com/zxm1002/p/4968428.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!