图书馆管理信息系统界面与代码精选.docVIP

  • 10
  • 0
  • 约3.3万字
  • 约 29页
  • 2018-01-31 发布于贵州
  • 举报

图书馆管理信息系统界面与代码精选.doc

图书馆管理信息系统界面与代码精选

图书馆管理信息系统界面与代码 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; namespace 图书馆管理信息系统 { public partial class frmLogin : Form { public frmLogin() { InitializeComponent(); } private void btnLogin_Click(object sender, EventArgs e) { try { if (txtUserName.Text == ) //判断用户是否输入了用户名 { MessageBox.Show(用户名不能为空); } else { if (txtPwd.Text == ) { MessageBox.Show(密码不能为空); //判断用户是否输入了密码 } else { SqlConnection con = DBCon.createCon();//创建数据库连接 con.Open(); SqlCommand cmd = new SqlCommand(select count(*)from Users where UserName= + txtUserName.Text + and UserPwd= + txtPwd.Text + , con); int i = Convert.ToInt32(cmd.ExecuteScalar()); //获取返回值 if (i 0) { if (cmbLogin.Text == ) { MessageBox.Show(请选择登录界面); cmbLogin.Focus(); return; } else if (cmbLogin.Text == 普通用户使用界面) { frmMain main = new frmMain(); main.adminname = txtUserName.Text; main.admintime = DateTime.Now.ToShortDateString(); main.Show(); this.Hide();//隐藏登录窗体 } else {

文档评论(0)

1亿VIP精品文档

相关文档