zoukankan      html  css  js  c++  java
  • 5.20 c#验证码练习

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace ConsoleApplication10
    {
        class Program
        {
            static void Main(string[] args)
            {
                Random ran = new Random();
                for (; ; )
                {
                    string aa = "", bb = "";
                    for (int l = 1; l <= 4; l++)
                    {
                        int b = ran.Next(36);
                        string[] c = new string[36]
                     {"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","1","2","3","4","5","6","7"
                    ,"8","9","0"};
                        aa = c[b];
                        bb += aa;
                    }
                        Console.WriteLine("验证码是:" + bb);
                        Console.Write("请输入验证码");
                        string ma = Console.ReadLine();
                        ma = ma.ToUpper();
                        if (ma == bb)
                        {
                            Console.WriteLine("验证码输入正确");
                            break;
                        }
                        else
                        {
                            Console.WriteLine("输入有误请重新输入");
                        }
                        Console.ReadLine();
    
                    }
                }
            }
        }
  • 相关阅读:
    鱼眼拼接实验
    多字节字符集 unicode字符集
    GPU编程接口
    零基础学java第一天
    最牛的减肥方法
    近期思考
    c++的stl容器
    蓝桥杯历年穷举题
    git简单指令3
    git简单指令2
  • 原文地址:https://www.cnblogs.com/suiyuejinghao123/p/5513848.html
Copyright © 2011-2022 走看看