登录界面: 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; using System.Data.SqlClient; namespace _123 { public partial class login : Form { public login() { InitializeComponent(); } private void quxaio_Click(object sender, EventArgs e) { MessageBox.Show("确定退出吗?"); this.Close(); } private void denglu_Click(object sender, EventArgs e) { if (this.zhanghao.Text.Trim() == ""|this.mima.Text.Trim()=="") { if(this.zhanghao.Text.Trim()=="") { MessageBox.Show("帐号不能为空!请从洙新输入!"); } else if (this.mima.Text.Trim() == "") { MessageBox.Show("密码不能为空!请从新输入!"); } } else { string ConnStr = @"server=.;database=user_db;uid=sa;pwd=zhangrui;"; SqlConnection conn = new SqlConnection(ConnStr); conn.Open(); 本文来源:https://www.wddqw.com/doc/c017ee8ba0116c175f0e48d6.html