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
{
QQ基本代码
最新推荐文章于 2022-10-27 10:24:13 发布