首页 > 其他 > 详细

随机验证码

时间:2015-08-09 15:27:56      阅读:267      评论:0      收藏:0      [点我收藏+]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _26个字母_0_9随机产生验证码
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入四位数验证码(第二位开始为字母 0-25表示)");
            string[] s1 = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" };
            
            Random rd = new Random();
            
            for (int i = 0; i < 10;)
            {
                Console.Write("验证码:"+rd.Next(0,9));
                Console.Write(" ");
                Console.Write(rd.Next(s1.Length));
                Console.Write(" ");
                Console.Write(rd.Next(s1.Length));
                Console.Write(" ");
                Console.WriteLine(rd.Next(s1.Length));
                Console.ReadLine();
                
            }
            
        }
    }
}

 

随机验证码

原文:http://www.cnblogs.com/xubin-747/p/4715137.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!