c语言应用源代码,[计算机软件及应用]图书管理系统_c语言源代码.doc

[计算机软件及应用]图书管理系统_c语言源代码

一个图书馆的管理系统,用c#做的,visual studio2008编写的。代码经测试全部实现,暂时未发现什么bug,在年纪的评比中得到了第一名的成绩。下面把这些代码分享给你们,希望能对你们有所帮助。

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)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值