FormMain.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 验证码模拟程序
{
    public partial class FormMain : Form
    {
        //倒计时时间
        int i = 60;

        public FormMain()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //判断输入验证
            if (textBox1.Text == "" || textBox1.TextLength != 6)
            {
                MessageBox.Show("验证码错误,请检查错误原因~~\n可能有以下原因:\n1.验证码为空\n2.验证码位数不正确\n3.验证码输入不正确","验证失败",MessageBoxButtons.OK,MessageBoxIcon.Error);
                //输入文本控件值为空
                textBox1.Text = null;
                //随机显示验证码
                Random rd = new Random();
                //验证码存储变量
                int yzm;
                //判断随机验证码长度是否等于6位
                for (;;)
                {
                    yzm = rd.Next(000000, 999999);
                    if (yzm.ToString().Length == 6)
                    {
                        break;
                    }
                }
                //刷新显示文本
                labelRead.Text = yzm.ToString()+" 秒";
            }
            //判断输入正确时提示
            else if (textBox1.Text.Equals(labelRead.Text))
            {
                MessageBox.Show("验证码输入正确!!!","验证成功", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                //输入文本控件值为空
                textBox1.Text = null;
                //随机显示验证码
                Random rd = new Random();
                //验证码存储变量
后面还有 61 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。