?? logindlg.cpp
字號:
// LoginDlg.cpp : implementation file
//
#include "stdafx.h"
#include "zhaoliang.h"
#include "LoginDlg.h"
#include "crypt.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern CDatabase db;
/////////////////////////////////////////////////////////////////////////////
// CLoginDlg dialog
CLoginDlg::CLoginDlg(CWnd* pParent /*=NULL*/)
: CDialog(CLoginDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CLoginDlg)
m_strDSN = _T("DD");
m_strUser = _T("AA");
m_strPasswd = _T("");
//}}AFX_DATA_INIT
}
void CLoginDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CLoginDlg)
DDX_CBString(pDX, IDC_CMD_DSN, m_strDSN);
DDX_Text(pDX, IDC_EDT_USER, m_strUser);
DDX_Text(pDX, IDC_EDT_PASSWD, m_strPasswd);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CLoginDlg, CDialog)
//{{AFX_MSG_MAP(CLoginDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CLoginDlg message handlers
BOOL CLoginDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
// 改變"登錄人事管理系統"字體大小
LOGFONT LogFont;
GetFont()->GetLogFont(&LogFont);
LogFont.lfHeight+=LogFont.lfHeight/2;
LogFont.lfWidth+=LogFont.lfWidth/2;
m_font.CreateFontIndirect(&LogFont);
GetDlgItem(IDC_STATIC_LOGINTEXT)->SetFont(&m_font);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CLoginDlg::OnOK()
{
BOOL bLogin=FALSE;
CString strPasswd, strAuthority;
UpdateData(); // 更新數據變量
// if(!db.Open(m_strDSN)) return; // 連接數據庫
// CRecordset rs(&db);
// rs.Open(CRecordset::forwardOnly,
// "select PASSWD, AUTHORITY from PERSON where ID='"+m_strUser+"'");
/*if(!rs.IsEOF())
{
rs.GetFieldValue("PASSWD", strPasswd);
rs.GetFieldValue("AUTHORITY", strAuthority);
if(//strPasswd == CCrypt::Encrypt(m_strPasswd, 123) &&
strAuthority == "1")
{
bLogin=TRUE; // 已連接
}
else
MessageBox("請重新輸入密碼。\n注意大小寫!","密碼錯誤");
}
else
{
MessageBox("請確認用戶名大小是否寫正確!","無此用戶");
}*/
// bLogin=TRUE;
// rs.Close();
// if(bLogin) EndDialog(IDOK);
// else db.Close(); // 關閉數據庫
CString xyy;
if(m_strUser=xyy)
{
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -