码迷,mamicode.com
首页 > Windows程序 > 详细

C#验证码的另一种操作方法

时间:2014-11-09 23:37:10      阅读:332      评论:0      收藏:0      [点我收藏+]

标签:blog   color   ar   os   sp   for   div   log   bs   

  sb = new StringBuilder();
            char c = ‘0‘;
            string s = "";
            for (int i = 0; i < 4; i++)
            {
                Random r = new Random();

                int a = r.Next(97, 122);

          //因为计算机处理速度很快,需要强制让线程睡一会, 不然结果会一样
System.Threading.Thread.Sleep(100); c = (char)a; sb.Append(c); } label4.ForeColor = Color.DarkRed; label4.Text = sb.ToString();

 

C#验证码的另一种操作方法

标签:blog   color   ar   os   sp   for   div   log   bs   

原文地址:http://www.cnblogs.com/codemouserman/p/4086127.html

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