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;
using MyQQ;
namespace qq
{
public partial class LoginFrm : Form
{
public LoginFrm()
{
InitializeComponent();
}
//窗体加载时
private void LoginFrm_Load(object sender, EventArgs e)
{
this.picFace.Image = this.imageFace.Images[0];
}
//文本框改变时发生的窗体
private void txtNum_TextChanged(object sender, EventArgs e)
{
if (this.txtNum.Text.Trim().Length == 5)
{
this.txtPwd.Focus();
string sql = string.Format("select FaceId from Users where Id = {0}", this.txtNum.Text);
SqlCommand cmd = new SqlCommand(sql, DbHelper.conn);
try
{
DbHelper.opendb();
this.picFace.Image = this.imageFace.Images[Convert.ToInt32(cmd.ExecuteScalar())];
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
finally
{
DbHelper.closedb();
QQ基本代码
最新推荐文章于 2025-02-28 00:36:57 发布

这是一个使用C#编写的QQ登录窗体应用,包含了初始化组件、QQ号码和密码验证、图片加载、数据库操作以及登录状态检查等功能。代码在文本框内容改变时会根据QQ号码查询用户头像,并在登录时检查账号密码的正确性以及登录状态。
最低0.47元/天 解锁文章
5380

被折叠的 条评论
为什么被折叠?



