form1.cs

来自「简单的通讯录程序」· CS 代码 · 共 49 行

CS
49
字号
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 OptDB
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            ClsDB.ClsDBControl Con = new OptDB.ClsDB.ClsDBControl();
            string strSql = "select * from user1 where name= '" + textBox1.Text + "' and passwaed = '" + textBox2.Text + "'";

            System.Data.SqlClient.SqlDataReader right = Con.cheat(strSql);
            Form5 form = new Form5();
            form.ShowDialog();
            if (right.HasRows)
            {
                
                //this.Hide();
            }
            else
                MessageBox.Show("用户名或密码错误!");
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Form2 form = new Form2();
            form.Show();
            this.Dispose(); 
        }

        private void button3_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?