Password.cpp
资源名称:Password.rar [点击查看]
上传用户:e531521e
上传日期:2022-05-23
资源大小:1835k
文件大小:3k
源码类别:
钩子与API截获
开发平台:
Visual C++
- // Password.cpp : Defines the class behaviors for the application.
- //
- #include "stdafx.h"
- #include "Password.h"
- #include "PasswordDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CPasswordApp
- BEGIN_MESSAGE_MAP(CPasswordApp, CWinApp)
- //{{AFX_MSG_MAP(CPasswordApp)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- // DO NOT EDIT what you see in these blocks of generated code!
- //}}AFX_MSG
- ON_COMMAND(ID_HELP, CWinApp::OnHelp)
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CPasswordApp construction
- CPasswordApp::CPasswordApp()
- {
- // TODO: add construction code here,
- // Place all significant initialization in InitInstance
- }
- /////////////////////////////////////////////////////////////////////////////
- // The one and only CPasswordApp object
- CPasswordApp theApp;
- /////////////////////////////////////////////////////////////////////////////
- // CPasswordApp initialization
- #include "PasswordDlg.h"
- BOOL CPasswordApp::InitInstance()
- {
- int nCount=0;
- while(nCount<3)
- {
- CPasswordDlg PassDlg;
- //添加用户号和密码
- if(PassDlg.DoModal()==IDOK)
- if((strcmp(PassDlg.m_strUserName,"0607080136")!=0)||
- (strcmp(PassDlg.m_strPassword,"196318")!=0))
- if((strcmp(PassDlg.m_strUserName,"0607080210")!=0)||
- (strcmp(PassDlg.m_strPassword,"709394")!=0))
- {
- MessageBox(NULL,"用户名或口令错误,请重试!",
- "错误信息",MB_OK|MB_ICONERROR);
- nCount++;
- }
- else
- break;
- else
- {
- return FALSE;
- }
- }
- if(nCount>=3)
- {
- MessageBox(NULL,"口令输入已经超过三次,请退出!",
- "错误信息",MB_OK|MB_ICONERROR);
- return FALSE;
- }
- AfxEnableControlContainer();
- // Standard initialization
- // If you are not using these features and wish to reduce the size
- // of your final executable, you should remove from the following
- // the specific initialization routines you do not need.
- #ifdef _AFXDLL
- Enable3dControls(); // Call this when using MFC in a shared DLL
- #else
- Enable3dControlsStatic(); // Call this when linking to MFC statically
- #endif
- CPasswordDlg dlg;
- m_pMainWnd = &dlg;
- int nResponse = dlg.DoModal();
- if (nResponse == IDOK)
- {
- // TODO: Place code here to handle when the dialog is
- // dismissed with OK
- }
- else if (nResponse == IDCANCEL)
- {
- // TODO: Place code here to handle when the dialog is
- // dismissed with Cancel
- }
- // Since the dialog has been closed, return FALSE so that we exit the
- // application, rather than start the application's message pump.
- return FALSE;
- }