为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

用户登录代码

2017-09-17 2页 doc 13KB 68阅读

用户头像

is_594886

暂无简介

举报
用户登录代码用户登录代码 priviate void button1_Click(object sender,System.EventArgs e) { SqlConnection conn=new SqlConnection("@Data Source="(local);Integrated Security=SSPI;Initial Catalog=DBApp""); SqlCommand cmd=conn.CreateCommand(); cmd.CommandType=CommandType.Text; cmd.Comm...
用户登录代码
用户登录代码 priviate void button1_Click(object sender,System.EventArgs e) { SqlConnection conn=new SqlConnection("@Data Source="(local);Integrated Security=SSPI;Initial Catalog=DBApp""); SqlCommand cmd=conn.CreateCommand(); cmd.CommandType=CommandType.Text; cmd.CommandType = CommandType.Text; if (txtUserName.Text.Length == 0) { MessageBox.Show("ÓÃ????ÄÜΪ?Õ??Çë?éÑ?ºóÊäÈë"); txtPassWord.Focus(); return; } cmd.CommandText = "select count(*) from UserList where UserName='" + txtUserName.Text + "'"; conn.Open(); if ((int)cmd.ExecuteScalar() == 0) { MessageBox.Show("???æÔÚ?ËÓÃ????Çë?ì?éºóÖØÐÂÊäÈë"); txtPassWord.Focus(); return; } cmd.CommandText = "select UserName, PassWord from UserList where PassWord='" +txtPassWord .Text + "'"; SqlDataReader myReader = cmd.ExecuteReader(); if (myReader.Read()) { if (txtPassWord.Text == myReader[0].ToString() && txtUserName.Text.Length != 0) ; MessageBox.Show("µÇÂ??É??", "??Ï?", MessageBoxButtons.OK, MessageBoxIcon.Information); frmMain fm = new frmMain(); fm.ShowDialog(); } else { MessageBox.Show("ÓÃ??" + txtUserName.Text + "µÄÃÜÂë??ÕýÈ?", "ÃÜÂë", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); txtPassWord.Focus(); return; } } private void button2_Click(object sender, EventArgs e) { this.Close(); } }
/
本文档为【用户登录代码】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索