📄 inputpwddlg.cpp
字号:
// 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -