c图书管理系统源代码档.doc
文本预览下载声明
学校的图书馆管理系统,这个是一个很实用的系统,相信很多做软件编程的都做过这个例子。下面这个是我的一个学生今年的毕业设计课题,做的不错,在学校的毕业设计中得到了优等,拿到省里面去评比了。
1.登陆界面
主要代码:
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.Text == )
{
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()
显示全部