QQ忘记密码代码

该博客介绍了如何通过编程方式实现QQ密码的重置。首先,需要在数据库创建一个表来存储QQID、密保问题及其答案。接着,文章会讲解具体的代码实现过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

首先需要在数据库中新建一张表把QQID、密保问题、密保答案都写进去

然后在进行一下代码编写:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;//SQL server、SQL语句所需命名空间。

namespace MyQQ
{
    public partial class SearchFrm : Form
    {
        public SearchFrm()
        {
            InitializeComponent();
        }
        //窗体加载时的
        private void SearchFrm_Load(object sender, EventArgs e)
        {
            //隐藏数据、按钮、容器控件
            this.dgvBase.Visible = false;
            this.dgvAdvance.Visible = false;
            this.btnAddFriends.Visible = false; ;
            this.btnUp.Visible = false;
            this.groupAdvance.Visible = false;
            //赋值与下拉框并且使下拉框只能选不能填
            this.cmbSex.Items.Add("--请选择--");
            this.cmbSex.Text = "--请选择--";
            this.cmbSex.Items.Add("男");
            this.cmbSex.Items.Add("女");
            this.cmbSex.DropDownStyle = ComboBoxStyle.DropDownList;
            this.cmbAge.Items.Add("--请选择--");
            this.cmbAge.Text = "--请选择--";
            this.cmbAge.Items.Add("18岁以下");
            this.cmbAge.Items.Add("18岁~25岁");
            this.cmbAge.Items.Add("25岁~35岁");
            this.cmbAge.Items.Add("35岁~45岁");
            this.cmbAge.Items.Add("46岁以上");
            this.cmbAge.DropDownStyle = ComboBoxStyle.DropDownList;
        }
        //点击此按钮显示容器控件并且txtNum得到焦点
        private void rdoAdvance_Click(object sender, EventArgs e)
        {
            this.groupAdvance.Visible = true;
            this.txtNum.Focus();
        }
        //点击此按钮隐藏容器并且文本框里面的值清空
        private void rdoAll_Click(object sender, EventArgs e)
        {
            this.txtNum.Text = "";
            this.txtNickName.Text = "";
            this.groupAdvance.Visible = false;
        }
        //基本查找的方法及情况
        public void BaseSearch()
        {
            string sql = "";
            if(this.rdoAll.Checked == true)
            {//查找所有人
                sql = "select Id,NickName,Age,Sex from users";
            }else if(this.rdoAdvance.Checked == true)
            {
                if (this.txtNum.Text == "" && this.txtNickName.Text == "")
                {
                    MessageBox.Show("请输入QQ号码或者昵称");
                    return;
                }
                if (this.txtNum.Text != "" && this.txtNickName.Text == "")
                {//1、有QQ号,无昵称
                    sql = string.Format("select id,nickname,age,sex from users where id={0}",this.txtNum.Text);
                }
                else if (this.txtNum.Text == "" && this.txtNickName.Text != "")
                {//2、无QQ号,有昵称
                    sql = string.Format("select id, nickname,age,sex from users where nickname='{0}'",this.txtNickName.Text);
                }
                else if (
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值