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();
评论0
最新资源