• 大小: 48KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-06-12
  • 语言: C#
  • 标签: C#  注册界面  验证  

资源简介

用C#语言制作winform窗口程序,实现注册窗口验证的功能

资源截图

代码片段和文件信息

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

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        public bool a  b  c  d  f ;
        private void textBox1_TextChanged(object sender EventArgs e)
        {
            if (this.textBox1.Text == ““)
            {
                this.label8.Visible = true;
                this.label8.Text = “用户名不能为空请输入用户名!“; a = false;
                
            }
            else
            {
                this.label8.Visible = true;
                this.label8.Text = “输入正确“; a = true;
            }
        }

        private void textBox2_TextChanged(object sender EventArgs e)
        {

            if ((Regex.IsMatch(this.textBox2.Text “[0-9][A-Za-z]“) || Regex.IsMatch(this.textBox2.Text “[A-Za-z][0-9]“)) && (this.textBox2.Text.Length > 6))
            {
                b = true;
                if ((this.textBox2.Text.Length > 6) && (this.textBox2.Text.Length < 10))
                {
                    this.label6.Text = “密码强度低级“; 
                }
                else 
                {
                    this.label6.Text=“密码强度高级“;
                }    
            }
            else
            {
                this.label6.Text = “长度要>=6,必须含有数字和字母“;
                b = false;
            }
        }

        private void textBox3_TextChanged(object sender EventArgs e)
        {
            if (this.textBox3.Text == ““)
            {
                this.label9.Text = “错误:不能为空“; c = false;
            }

            else if (this.textBox2.Text == this.textBox3.Text)
            {
                this.label9.Text = “正确“; c = true;
            }
            else
            {
                this.label9.Text = “错误:两次输入的密码不一致“; c = false;
            }
        }

        private void textBox4_TextChanged(object sender EventArgs e)
        {
            if (Regex.IsMatch(this.textBox4.Text “[A-Za-z0-9][@][A-Za-z0-9]+[.][A-Za-z0-9]“))
            {
                this.label10.Text = “输入正确“; d = true;
            }
            else
            {
                this.label10.Text = “非法邮箱“; d = false;
            }
        }

        private void textBox5_TextChanged(object sender EventArgs e)
        {
            if (Regex.IsMatch(this.textBox5.Text @“^((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})-0?2-(0?[1-9]|1\d|2[0-8]))|(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))-0?2-29-))$“))
            {
                this.label7.Text = “输入正确“; f = true;
            }
        

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      13312  2011-09-13 19:24  注册界面\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe

     文件      28160  2011-09-13 19:24  注册界面\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.pdb

     文件      11600  2011-09-13 18:14  注册界面\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe

     文件        490  2010-03-17 22:39  注册界面\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.manifest

     文件       3680  2011-09-13 19:27  注册界面\WindowsFormsApplication1\Form1.cs

     文件      10811  2011-09-07 21:23  注册界面\WindowsFormsApplication1\Form1.Designer.cs

     文件       5817  2011-09-07 21:23  注册界面\WindowsFormsApplication1\Form1.resx

     文件       4440  2011-09-06 20:49  注册界面\WindowsFormsApplication1\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       6271  2011-09-13 19:24  注册界面\WindowsFormsApplication1\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件        284  2011-09-07 21:23  注册界面\WindowsFormsApplication1\obj\x86\Debug\GenerateResource.read.1.tlog

     文件        734  2011-09-07 21:23  注册界面\WindowsFormsApplication1\obj\x86\Debug\GenerateResource.write.1.tlog

     文件       7897  2011-09-06 21:06  注册界面\WindowsFormsApplication1\obj\x86\Debug\ResolveAssemblyReference.cache

     文件        952  2011-09-13 19:10  注册界面\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.csproj.FileListAbsolute.txt

     文件      13312  2011-09-13 19:24  注册界面\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.exe

     文件        180  2011-09-07 21:23  注册界面\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.Form1.resources

     文件      28160  2011-09-13 19:24  注册界面\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.pdb

     文件        180  2011-09-06 08:28  注册界面\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.Properties.Resources.resources

     文件        505  2011-09-06 08:09  注册界面\WindowsFormsApplication1\Program.cs

     文件       1380  2011-09-06 08:09  注册界面\WindowsFormsApplication1\Properties\AssemblyInfo.cs

     文件       2898  2011-09-06 08:09  注册界面\WindowsFormsApplication1\Properties\Resources.Designer.cs

     文件       5612  2011-09-06 08:09  注册界面\WindowsFormsApplication1\Properties\Resources.resx

     文件       1109  2011-09-06 08:09  注册界面\WindowsFormsApplication1\Properties\Settings.Designer.cs

     文件        249  2011-09-06 08:09  注册界面\WindowsFormsApplication1\Properties\Settings.settings

     文件       3707  2011-09-06 08:28  注册界面\WindowsFormsApplication1\WindowsFormsApplication1.csproj

     文件        914  2011-09-06 08:09  注册界面\注册界面.sln

    ..A..H.     19968  2011-09-13 19:27  注册界面\注册界面.suo

     目录          0  2011-09-06 08:09  注册界面\WindowsFormsApplication1\obj\x86\Debug\TempPE

     目录          0  2011-09-13 22:01  注册界面\WindowsFormsApplication1\obj\x86\Debug

     目录          0  2011-09-13 22:01  注册界面\WindowsFormsApplication1\bin\Debug

     目录          0  2011-09-13 22:01  注册界面\WindowsFormsApplication1\obj\x86

............此处省略8个文件信息

评论

共有 条评论