c#简单的就业调查表

来源:互联网 发布:linux gradle 下载 编辑:程序博客网 时间:2024/05/18 03:02

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 ccccccccccccc{    public partial class Form1 : Form    {        public Form1()        {            InitializeComponent();        }        private void button1_Click(object sender, EventArgs e)        {            if(textBox1.Text=="")            {                MessageBox.Show("请输入姓名", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);                textBox1.Focus();                return;            }            if(comboBox1.Text=="")            {                MessageBox.Show("请选择入学年份","提示",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);                comboBox1.Focus();                return;            }            if(textBox2.Text=="")            {                MessageBox.Show("请输入Email地址","提示",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);                textBox2.Focus();                return;            }            if(textBox2.Text.IndexOf('@')==-1||textBox2.Text.IndexOf('@')==0|| textBox2.Text.IndexOf('@')> textBox2.Text.Length-6)            {                MessageBox.Show("E-mail地址有误","提示",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);                textBox2.Focus();                return;            }            MessageBox.Show(textBox1.Text+"你好,谢谢你的参与!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information);            this.Close();        }    }}


0 0