[求助]登录代码
师兄姐们:帮我整个完整的系统登录代码吧,小弟不胜感激!!!
private void button1_Click(object sender, System.EventArgs e)
{
DataAccess ds=new DataAccess();
string name=this.userName.Text.Trim();
string pwd=this.password.Text.Trim();
string strSql="SELECT * FROM administrator where username='"+name+ "' and password='"+pwd+"'";
if(ds.GetCount(strSql)>0)
{
WinMain wm=new WinMain();
wm.ShowDialog();
this.Close();
}
else
{
MessageBox.Show("请正确输入你的用户名和密码");
}
}
这个是我刚才下lw817810的学生管理系统的登录窗口的代码,看得懂了吧