C#图书管理系统(全)源代码!
源代码,一看就知道!开头部分,下面的自己下载下来看吧! public partial class LoginForm : Form{ public static string uacc; public static string upsw; public static string uname; public static string usex; public static string upart; public static string uright; public LoginForm() { InitializeComponent(); } private void loginbtn_Click(object sender, EventArgs e) { if (this.useracctxt.Text.Trim() == "" && this.pswtxt.Tex t == "") { MessageBox.Show("请输入您的用户名和密码!", "提示!"); return; } try { string sql; sql = "select * from tb_user where uacc='" + this.useracctxt.Text + "' and upsw='" + this.pswtxt.Text + "'"; OleDbDataReader dr = DBHelp.OleReader(sql); dr.Read(); if (dr.HasRows) { uacc = this.useracctxt.Text; upsw = this.pswtxt.Text; uname = dr["uname"].ToString(); usex = dr["usex"].ToString(); upart = dr["upart"].ToString(); uright = dr["uright"].ToString(); MainForm af = new MainForm(this); this.Hide(); this.useracctxt.Clear(); this.pswtxt.Clear(); af.Show(); } else { MessageBox.Show("账号或密码错误!", "提示!"); this.useracctxt.Clear(); this.pswtxt.Clear(); this.useracctxt.Focus(); } } catch (Exception) { MessageBox.Show("数据库无法连接!", "警告!"); } } private void cancelbtn_Click(object sender, EventArgs e) { Application.Exit(); } private void LoginForm_Closing(object sender, FormClosingEventArgs e) { Application.Exit(); } t == "") { MessageBox.Show("请输入您的用户名和密码!", "提示!"); return; } try { string sql; sql = "select * from tb_user where uacc='" + this.useracctxt.Text + "' and upsw='" + this.pswtxt.Text + "'"; OleDbDataReader dr = DBHelp.OleReader(sql); dr.Read(); if (dr.HasRows) { uacc = this.useracctxt.Text; upsw = this.pswtxt.Text; uname = dr["uname"].ToString(); usex = dr["usex"].ToString(); upart = dr["upart"].ToString(); uright = dr["uright"].ToString(); MainForm af = new MainForm(this); this.Hide(); this.useracctxt.Clear(); this.pswtxt.Clear(); af.Show(); } else { MessageBox.Show("账号或密码错误!", "提示!"); this.useracctxt.Clear(); this.pswtxt.Clear(); this.useracctxt.Focus(); } } catch (Exception) { MessageBox.Show("数据库无法连接!", "警告!"); } } private void cancelbtn_Click(object sender, EventArgs e) { Application.Exit(); } private void LoginForm_Closing(object sender, FormClosingEventArgs e) { Application.Exit(); }
下载地址
用户评论
还可以吧 哈哈
感觉这个有点水
还行吧,学一下看看还可以
代码很好 全面 就是数据库不完整
还可以哦,可以用来学习一下啦
还不错吧,但有些有些乱
有错误 需要改
程序还可以就是步骤方法不是很全
代码可以,不过数据库是不完整的 稍有遗憾 还是不错的
以为是程序,结果是文档