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

📄 logindlg.cpp

📁 用C++写的数据库软件
💻 CPP
字号:
// LoginDlg.cpp : implementation file
//

#include "stdafx.h"
#include "fksqxt.h"
#include "LoginDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CLoginDlg dialog


CLoginDlg::CLoginDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CLoginDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CLoginDlg)
	m_pwd = _T("");
	m_name = _T("");
	//}}AFX_DATA_INIT
	boolIsSuccess = false;
}


void CLoginDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CLoginDlg)
	DDX_Text(pDX, IDC_pwd, m_pwd);
	DDX_Text(pDX, IDC_username, m_name);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CLoginDlg, CDialog)
	//{{AFX_MSG_MAP(CLoginDlg)
	ON_BN_CLICKED(IDC_login, Onlogin)
	ON_BN_CLICKED(IDC_exit, Onexit)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CLoginDlg message handlers

void CLoginDlg::Onlogin() 
{
	UpdateData(TRUE);
//	MessageBox(m_name);
	if(m_name.Compare("admin")==0 && m_pwd.Compare("admin") == 0)
	{
		MessageBox("欢迎您,管理员:admin");
		boolIsSuccess = true;
		CDialog::EndDialog(0);
	}
	else
	{
		MessageBox("用户名不存在,或密码错误!");
		m_name = "";
		m_pwd = "";
		UpdateData(FALSE);
	}
}

bool CLoginDlg::isSuccess()
{
	return boolIsSuccess;
}



void CLoginDlg::Onexit() 
{
	// TODO: Add your control notification handler code here
	EndDialog(0);
}

⌨️ 快捷键说明

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