⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.cs

📁 简单的通讯录程序
💻 CS
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -