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

📄 modifypsdlg.cpp

📁 VC++开发的一个电话录音程序
💻 CPP
字号:
// ModifyPsDlg.cpp : implementation file
//

#include "stdafx.h"
#include "phonerec.h"
#include "ModifyPsDlg.h"
#include "mainfrm.h" 


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

/////////////////////////////////////////////////////////////////////////////
// CModifyPsDlg dialog


CModifyPsDlg::CModifyPsDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CModifyPsDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CModifyPsDlg)
	m_strNewPsw1 = _T("");
	m_strNewPsw2 = _T("");
	m_strOldPsw = _T("");
	//}}AFX_DATA_INIT
}

void CModifyPsDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CModifyPsDlg)
	DDX_Control(pDX, IDC_BUTTON_PSW, m_btnPsw);
	DDX_Text(pDX, IDC_EDIT_NEW_PSW1, m_strNewPsw1);
	DDX_Text(pDX, IDC_EDIT_NEW_PSW2, m_strNewPsw2);
	DDX_Text(pDX, IDC_EDIT_OLD_PSW, m_strOldPsw);
	//}}AFX_DATA_MAP
}


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

/////////////////////////////////////////////////////////////////////////////
// CModifyPsDlg message handlers

BOOL CModifyPsDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	m_btnPsw.SetIcon( IDR_PSW );

	m_strOldPsw = ( ( CMainFrame*)( AfxGetMainWnd( ) ) )->m_userTable.m_strPsw;

	UpdateData( FALSE );

	return TRUE;           
}

void CModifyPsDlg::OnOK() 
{
	UpdateData(TRUE);
	if(m_strNewPsw1.Compare(m_strNewPsw2))
	{
		AfxMessageBox("你密码不一致,请重新输入 ! ");
		return ;
	}
	UpdateData( TRUE );
	if( !m_strNewPsw1.Compare( m_strNewPsw2 ) )
	{
		( ( CMainFrame*)( AfxGetMainWnd( ) ) )->m_userTable.UpdateUserPsw( ( ( CMainFrame*)( AfxGetMainWnd( ) ) )->m_userTable.m_strName, m_strNewPsw1 );
		( ( CMainFrame*)( AfxGetMainWnd( ) ) )->m_userTable.m_strPsw = m_strNewPsw1;
	}
	CDialog::OnOK();
}

⌨️ 快捷键说明

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