文档介绍:图书管理系统(内附源代码)
2
———————————————————————————————— 作者:
———————————————————————————————— 日期:
个人收集整理 勿做商业用途
个人收集整理 勿做商业用途
个人收集整理 勿做商业用途
本人是一个初学者,2个月前学****C#,学****过程中遇到过许多困难无法独立解决,现在做成了第一个系统:图书管理系统,各项功能均能顺利实现,因为知道很多初学者和我一样苦无求学之道,现在将部分主要源码上传,希望能得到高手的指点.
下面就是该系统的主要功能及代码:
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 (。Text。Trim() == ”” && 。Text == ””)
{
MessageBox。Show(”请输入您的用户名和密码!", "提示!”);
return;
}
try
{
string sql;
sql = "select * from tb_user where uacc='” + 。Text + ”’ and upsw=’" + this。pswtxt。Text + "'”;
OleDbDataReader dr = (sql);
();
if (dr。HasRows)
3
个人收集整理 勿做商业用途
个人收集整理 勿做商业用途
个人收集整理 勿做商业用途
{
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。useracctxt。Clear();