⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 logindialog.cpp

📁 mfc对话框 mfc对话框 mfc对话框 mfc对话框
💻 CPP
字号:
// LoginDialog.cpp : implementation file
//

#include "stdafx.h"
#include "diag.h"
#include "LoginDialog.h"

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

/////////////////////////////////////////////////////////////////////////////
// CLoginDialog dialog


CLoginDialog::CLoginDialog(CWnd* pParent /*=NULL*/)
	: CDialog(CLoginDialog::IDD, pParent)
{
	//{{AFX_DATA_INIT(CLoginDialog)
	m_szLoginName = _T("");
	m_szPassword = _T("");
	//}}AFX_DATA_INIT
}


void CLoginDialog::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CLoginDialog)
	DDX_Text(pDX, IDC_LOGINNAME, m_szLoginName);
	DDX_Text(pDX, IDC_PASSWORD, m_szPassword);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CLoginDialog, CDialog)
	//{{AFX_MSG_MAP(CLoginDialog)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CLoginDialog message handlers

void CLoginDialog::OnOK() 
{
if(m_szLoginName=="user" && m_szPassword=="test1234") 
{
	MessageBox("用户通过","标题",MB_OK);

}
else 
{
	MessageBox("未通过","标题",MB_OK);
	AfxGetMainWnd()->PostMessage(WM_QUIT);

}
	CDialog::OnOK();
}

void CLoginDialog::OnCancel() 
{
MessageBox("验证失败","标题",MB_OK);
AfxGetMainWnd()->PostMessage(WM_QUIT);	
	CDialog::OnCancel();
}

⌨️ 快捷键说明

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