主要代码:
public partial class LoginForm : Form{
public static string ;
public static string upsw;
public static string uname;
public static string usex;
public static string upart;
public static string uright;
public LoginForm()
{
ponent();
}
private void loginbtn_Click(object sender, EventArgs e)
{
if (() == "" && == "")
{
("请输入您的用户名和密码!", "提示!");
return;
}
try
{
string sql;
sql = "select * from tb_user where ='" + + "' and upsw='" + + "'";
OleDbDataReader dr = (sql);
();
if ()
{
= ;
upsw = ;
uname = dr["uname"].ToString();
usex = dr["usex"].ToString();
upart = dr["upart"].ToString();
uright = dr["uright"].ToString();
MainForm af = new MainForm(this);
();
();
();
();
}
else
{
("账号或密码错误!", "提示!");
();
();
();
}
}
catch (Exception)
{
("数据库无法连接!", "警告!");
}
}
private void cancelbtn_Click(object sender, EventArgs e)
{
();
}
private void LoginForm_Closing(object sender, FormClosingEventArgs e)
{
();
}
}
(图较小,自己可以拉大点)
主要代码就不写了,很简单。
主要代码:
public partial class RightSet : Form
{
public RightSet()
{
ponent();
}
private void RightSet_Load(object sender, EventArgs e)
{
= 0;
//();
Fill();
}
private void okbtn_Click(object sender, EventArgs e)
{
if ( == )
{
("请输入最大借阅图书数量!", "提示!");
return;
}
if ( == )
{
("请输入最大借阅图书时间!", "提示!");
return;
}
if ( == )
{
("请输入借书押金金额!", "提示!");
return;
}
if ( == strin
c#图书管理系统源代码 来自淘豆网m.daumloan.com转载请标明出处.