📄 login.cpp
字号:
// Login.cpp : implementation file
//
#include "stdafx.h"
#include "resource.h"
#include "Login.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// Login dialog
Login::Login(CWnd* pParent /*=NULL*/)
: CDialog(Login::IDD, pParent)
{
//{{AFX_DATA_INIT(Login)
m_flag = _T("");
m_Password = _T("");
//}}AFX_DATA_INIT
}
void Login::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(Login)
DDX_Text(pDX, EDIT_Password, m_Password);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(Login, CDialog)
//{{AFX_MSG_MAP(Login)
ON_BN_CLICKED(BUTTON_Login, OnLogin)
ON_BN_CLICKED(BUTTON_Exit, OnExit)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Login message handlers
void Login::OnLogin()
{
// TODO: Add your control notification handler code here
CString CSPassword;
GetDlgItemText(EDIT_Password,CSPassword);
if (CSPassword=="2006")
{
m_flag="Success";
SendMessage(WM_CLOSE);
}
else
{
AfxMessageBox(L"Failed Password!");
SetDlgItemText(EDIT_Password,TEXT(""));
GetDlgItem(EDIT_Password)->SetFocus();
}
}
void Login::OnExit()
{
// TODO: Add your control notification handler code here
m_flag="fail";
SendMessage(WM_CLOSE);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -