简单的管理系统

这篇博客主要介绍了简单的管理系统,包括首页面、学生页面和老师页面这三个主要部分。
摘要由CSDN通过智能技术生成

首页面 

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 Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            //默认选项为第一个
            comboBox1.SelectedIndex = 0;
            //只读
            comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
        }
        const string teacherid = "123456", teacherpwd = "123abc";
        const string studentid = "654321", studentpwd = "321abc";

        private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        //登录按钮
        private void button1_Click(object sender, EventArgs e)
        {
            //接收密码
            string id = maskedTextBox1.Text;
            string pwd = textBox1.Text;
            if (id==""||pwd=="")
            {
                MessageBox.Show("请输入必填项");
                return;
            }
            //选择框
            string Checkbox = comboBox1.SelectedItem.ToString();
            //判断登录
            switch (Checkbox)
            {
                case "老师":
                    if (teacherid==id&&teacherpwd==pwd)
                    {
                        Form2 sheet = new Form2();
                        sheet.Show();
                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("登陆失败");
                    }
                    break;
                case "学生":
                    if (studentid == id && studentpwd == pwd)
                    {
                        Form3 sheet = new Form3();
                        sheet.Show();
                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("登陆失败");
                    }
                    break;
                default:
                    break;
            }
        }
    }
}

学生页面 

 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
usi
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值