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

c#qq登录界面

2018-04-13 5页 doc 18KB 25阅读

用户头像

is_954223

暂无简介

举报
c#qq登录界面c#qq登录界面 登录界面 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; namespace qq { public partial...
c#qq登录界面
c#qq登录界面 登录界面 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; namespace qq { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button2_Click(object sender, EventArgs e) { zhuce zhu = new zhuce(); zhu.Show(); this.Visible = false; } private void button1_Click(object sender, EventArgs e) { string id = textBox1.Text; SqlConnection con = new SqlConnection(@"Data Source=LENOVO-PC\SQLEXPRESS;Initial Catalog=qq;Integrated Security=True"); con.Open(); SqlCommand b = new SqlCommand("select * from qq where id="+id, con); SqlDataReader c = b.ExecuteReader(); while (c.Read()) { if (this.textBox1.Text.Equals(c["id"].ToString())) { if (this.textBox1.Text.Equals(c["id"].ToString()) && this.textBox2.Text.Equals(c["password"].ToString())) { MessageBox.Show("正确"); break; } //else //{ // Response.Write("abc"); //} if (this.textBox1.Text.Equals(c["id"].ToString()) && !this.textBox2.Text.Equals(c["password"].ToString())) { MessageBox.Show("密码错误!"); break; } } else { MessageBox.Show("用户不存在!请重新输入"); break; } } } } } 注册界面 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.Sql; using System.Data.SqlClient; using System.Data.SqlTypes; namespace qq { public partial class zhuce : Form { public zhuce() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { string id = textBox1.Text; string password = textBox2.Text; if (textBox2.Text != textBox3.Text) { MessageBox.Show("密码不一致,请重新输入~"); } SqlConnection con = new SqlConnection(@"Data Source=LENOVO-PC\SQLEXPRESS;Initial Catalog=qq;Integrated Security=True"); try { con.Open(); string strsql = "insert into qq values ('" + id + "','" + password + "')"; SqlCommand cmd = new SqlCommand(strsql, con); cmd.ExecuteNonQuery(); label4.Text = "注册成功~"; } catch { label5.Text = "注册失败!"; } finally { con.Close(); } } private void label5_Click(object sender, EventArgs e) { Form1 cai = new Form1(); cai.Show(); this.Visible = false; } } }
/
本文档为【c#qq登录界面】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索