123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- // DlgEditPwd.cpp : 实现文件
- //
- #include "stdafx.h"
- #include "IDE.h"
- #include "DlgEditPwd.h"
- #include ".\dlgeditpwd.h"
- #include "md5class.h"
- // CDlgEditPwd 对话框
- IMPLEMENT_DYNAMIC(CDlgEditPwd, CDialog)
- CDlgEditPwd::CDlgEditPwd(CWnd* pParent /*=NULL*/)
- : CDialog(CDlgEditPwd::IDD, pParent)
- {
- }
- CDlgEditPwd::~CDlgEditPwd()
- {
- }
- void CDlgEditPwd::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- DDX_Control(pDX, IDC_EDIT_OLD_PWD, m_ctrlOldPwd);
- DDX_Control(pDX, IDC_EDIT_NEW_PWD, m_ctrlNewPwd);
- DDX_Control(pDX, IDC_EDIT_CONFIRM_PWD, m_ctrlConfirmPwd);
- }
- BEGIN_MESSAGE_MAP(CDlgEditPwd, CDialog)
- ON_BN_CLICKED(IDOK, OnBnClickedOk)
- ON_BN_CLICKED(IDCANCEL, OnBnClickedCancel)
- ON_WM_SHOWWINDOW()
- END_MESSAGE_MAP()
- // CDlgEditPwd 消息处理程序
- void CDlgEditPwd::OnBnClickedOk()
- {
- // TODO: 在此添加控件通知处理程序代码
- UpdateData(TRUE);
- CString strNewPwd, strOldPwd, strConfirmPwd, strMsg;
- //检查数据有效性
- m_ctrlOldPwd.GetWindowText(strOldPwd);
- m_ctrlNewPwd.GetWindowText(strNewPwd);
- m_ctrlConfirmPwd.GetWindowText(strConfirmPwd);
- CMD5 md5OldPwd;
- md5OldPwd.setPlainText( (char *)(LPCTSTR)strOldPwd );
- CMD5 md5NewPwd;
- md5NewPwd.setPlainText( (char *)(LPCTSTR)strNewPwd );
- if(strOldPwd.IsEmpty())
- {
- MessageBox(g_strOldPasswordCannotBlank, g_strTip, MB_ICONINFORMATION);
- m_ctrlOldPwd.SetWindowText("");
- m_ctrlNewPwd.SetWindowText("");
- m_ctrlConfirmPwd.SetWindowText("");
- m_ctrlOldPwd.SetFocus();
- return;
- }
- MessageBox(g_strModifyPwdOK, g_strTip, MB_ICONINFORMATION);
- OnOK();
- }
- void CDlgEditPwd::OnBnClickedCancel()
- {
- // TODO: 在此添加控件通知处理程序代码
- OnCancel();
- }
- BOOL CDlgEditPwd::OnInitDialog()
- {
- CDialog::OnInitDialog();
- // TODO: 在此添加额外的初始化
- CString str,s;
- GetDlgItem(IDC_STA_SHOW)->GetWindowText( s );
- str.Format("%s < %s >",s,g_strLoginUserID );
- GetDlgItem(IDC_STA_SHOW)->SetWindowText( str );
- return TRUE; // return TRUE unless you set the focus to a control
- // 异常: OCX 属性页应返回 FALSE
- }
- void CDlgEditPwd::OnShowWindow(BOOL bShow, UINT nStatus)
- {
- CDialog::OnShowWindow(bShow, nStatus);
- // TODO: 在此处添加消息处理程序代码
- m_ctrlOldPwd.SetFocus();
- }
|