练习:WinForm(教师学生系统登录)

Posted 庚xiao午

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了练习: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;

namespace 学生教师登录
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void rdoStudent_CheckedChanged(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (rdoStudent.Checked || rdoTeacher.Checked)
            {
                string name = txtName.Text.Trim();
                string pwd = txtPWD.Text;
                //选择学生
                if (rdoStudent.Checked)
                {
                    if (name == "student" && pwd == "student")
                    {
                        MessageBox.Show("学生登陆成功");
                    }
                    else
                    {
                        MessageBox.Show("登录失败");
                        txtName.Clear();
                        txtPWD.Clear();
                        txtName.Focus();
                    }
                }
                //选择老师
                else
                {
                    if (name == "teacher" && pwd == "teacher")
                    {
                        MessageBox.Show("教师登陆成功");
                    }
                    else
                    {
                        MessageBox.Show("登录失败");
                        txtName.Clear();
                        txtPWD.Clear();
                        txtName.Focus();
                    }
                }
            }

            else 
            {
                MessageBox.Show("请首先选择登录身份");
            }
        }
    }
}

 

以上是关于练习:WinForm(教师学生系统登录)的主要内容,如果未能解决你的问题,请参考以下文章

练习. SQL--学生教师分数

学生信息管理系统

IDEA+Java+Servlet+JSP+Bootstrap+Mysql实现Web学生成绩管理系统

IDEA+Java+Servlet+JSP+Bootstrap+Mysql实现Web学生成绩管理系统

Python练习学生管理系统

Java设计开发一个简单的学生管理系统!