📄 entry.cpp
字号:
// Entry.cpp : implementation file
//
#include "stdafx.h"
#include "ShopManage.h"
#include "Entry.h"
#include "DataManage.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CEntry dialog
CEntry::CEntry(CWnd* pParent /*=NULL*/)
: CDialog(CEntry::IDD, pParent)
{
//{{AFX_DATA_INIT(CEntry)
m_UserCode = _T("");
m_UserName = _T("");
//}}AFX_DATA_INIT
tcode = "";
}
void CEntry::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CEntry)
DDX_Text(pDX, IDC_UserCode, m_UserCode);
DDX_Text(pDX, IDC_UserName, m_UserName);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CEntry, CDialog)
//{{AFX_MSG_MAP(CEntry)
ON_BN_CLICKED(IDC_Entry, OnEntry)
ON_WM_CLOSE()
ON_BN_CLICKED(IDC_EntryClose, OnEntryClose)
ON_EN_UPDATE(IDC_UserCode, OnUpdateUserCode)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CEntry message handlers
void CEntry::OnOK()
{
// TODO: Add extra validation here
//CDialog::OnOK();
}
void CEntry::OnEntry()
{
// TODO: Add your control notification handler code here
//UpdateData(TRUE);
m_UserCode = tcode;
//MessageBox(tcode,"密码");
if(m_UserName == "" && m_UserCode == "")
{
MessageBox("请输入登录信息","提示");
return;
}
if(m_UserName != "laoshupi")
MessageBox("用户名不正确","出错");
else
{
if(m_UserCode == "123")
{
Enable = true;
EndDialog(0);
}
else
MessageBox("密码不正确","出错");
}
}
void CEntry::OnClose()
{
// TODO: Add your message handler code here and/or call default
MessageBox("请输入登录信息","提示");
//CDialog::OnClose();
}
void CEntry::OnEntryClose()
{
// TODO: Add your control notification handler code here
Enable = false;
EndDialog(0);
}
void CEntry::OnUpdateUserCode()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function to send the EM_SETEVENTMASK message to the control
// with the ENM_UPDATE flag ORed into the lParam mask.
// TODO: Add your control notification handler code here
UpdateData(TRUE);
if(m_UserCode.GetLength() == 0)
{
tcode="";
return;
}
tcode+=m_UserCode.GetAt(0);
CString mcode = "";
for(int i=0;i<m_UserCode.GetLength();i++)
mcode+="*";
m_UserCode = mcode;
UpdateData(FALSE);
}
BOOL CEntry::PreTranslateMessage(MSG* pMsg)
{
return CDialog::PreTranslateMessage(pMsg);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -