登陆界面 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace Labrary { public partial class FormLogin : Form { public FormLogin() { InitializeComponent(); } /// /// 验¨¦证¡è控?件t /// /// private bool ValidControl() { if (this.tbID.Text == "") { MessageBox.Show("请填写用户名!ê?"); this.tbID.Focus(); return false; } if (this.tbID.Text != "admin") { if (!UserManage.ObjUser.IsHasID(All.dbo, this.tbID.Text)) { MessageBox.Show("不存在此用户!ê?"); this.tbID.Text = ""; this.tbID.Focus(); return false; } } if (this.tbID.Text != "admin") { UserManage.ObjUser user= new UserManage.ObjUser(this.tbID.Text, All.dbo); if (user.PWD != this.tbPWD.Text) { MessageBox.Show("密码错误!ê?"); this.tbPWD.Text = ""; this.tbPWD.Focus(); return false; } } else { if (this.tbPWD.Text != "123456") { MessageBox.Show("密码错误! "); this.tbPWD.Text = ""; this.tbPWD.Focus(); return false; } } return true; } private void gbtnCancel_Click(object sender, EventArgs e) { this.Close(); } private void gbtnOK_Click(object sender, EventArgs e) { //如¨?果?验¨¦证¡è控?件t通ª¡§ 过y if (ValidControl()) { if (this.tbID.Text != "admin") { All.userLogin = new UserManage.ObjUser(this.tbID.Text, All.dbo); } else { All.userLogin = new UserManage.ObjUser(All.dbo); All.userLogin.ID = "admin"; All.userLogin.Name = "管理员"; } this.DialogResult = DialogResult.OK; this.Close(); } } } } 主界面 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace Labrary { public partial class FormMain : Form { public const int WM_USER = 0x0400; p...