inputpwddlg.cpp

来自「通讯录管理系统1.0 可以为您方便地, 安全地管理你的通讯录, 是您的家庭好帮」· C++ 代码 · 共 77 行

CPP
77
字号
// InputPwdDlg.cpp : implementation file
//

#include "stdafx.h"
#include "SGAdrLstMS.h"
#include "InputPwdDlg.h"


#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CInputPwdDlg dialog


CInputPwdDlg::CInputPwdDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CInputPwdDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CInputPwdDlg)
	m_password = _T("");
	//}}AFX_DATA_INIT
}


void CInputPwdDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CInputPwdDlg)
	DDX_Text(pDX, IDC_PASSWORD, m_password);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CInputPwdDlg, CDialog)
	//{{AFX_MSG_MAP(CInputPwdDlg)
	ON_WM_SHOWWINDOW()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CInputPwdDlg message handlers

void CInputPwdDlg::OnOK() 
{
	db.Open();
	db.MoveFirst();
	this->UpdateData(true);
	if (!this->Mathcode())
	{
		MessageBox("密码错误","登陆失败",MB_ICONSTOP);
		
		this->m_password="";
		this->UpdateData(false);
		this->GetDlgItem(IDC_PASSWORD)->SetFocus();
		db.Close();
		return;
	}
	db.Close();
	CDialog::OnOK();
}

void CInputPwdDlg::OnShowWindow(BOOL bShow, UINT nStatus) 
{
	CDialog::OnShowWindow(bShow, nStatus);
	
	this->GetDlgItem(IDC_PASSWORD)->SetFocus();	
}


bool CInputPwdDlg::Mathcode()
{
	return  db.m_pwd == this->m_password;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?