InputPsw.cpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // InputPsw.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "LYFZIPManage.h"
  5. #include "InputPsw.h"
  6. #include "mysqldata.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. /////////////////////////////////////////////////////////////////////////////
  13. // InputPsw dialog
  14. InputPsw::InputPsw(CWnd* pParent /*=NULL*/)
  15. : CDialog(InputPsw::IDD, pParent)
  16. {
  17. //{{AFX_DATA_INIT(InputPsw)
  18. m_psw = _T("");
  19. m_psw2="werdfgt";
  20. //}}AFX_DATA_INIT
  21. }
  22. void InputPsw::DoDataExchange(CDataExchange* pDX)
  23. {
  24. CDialog::DoDataExchange(pDX);
  25. //{{AFX_DATA_MAP(InputPsw)
  26. DDX_Text(pDX, IDC_EDIT1, m_psw);
  27. //}}AFX_DATA_MAP
  28. }
  29. BEGIN_MESSAGE_MAP(InputPsw, CDialog)
  30. //{{AFX_MSG_MAP(InputPsw)
  31. //}}AFX_MSG_MAP
  32. END_MESSAGE_MAP()
  33. /////////////////////////////////////////////////////////////////////////////
  34. // InputPsw message handlers
  35. void InputPsw::OnOK()
  36. {
  37. // TODO: Add extra validation here
  38. UpdateData();
  39. if(m_psw==m_psw2)
  40. CDialog::OnOK();
  41. }
  42. BOOL InputPsw::OnInitDialog()
  43. {
  44. CDialog::OnInitDialog();
  45. // TODO: Add extra initialization here
  46. GetDlgItem(IDC_EDIT1)->SetFocus();
  47. MyLock lock("xiaoaccessdbmsg");
  48. CRecordset myset(&g_db);
  49. CString sql="select psw from psw";
  50. myset.Open (CRecordset::forwardOnly, sql);
  51. myset.GetFieldValue ("psw", m_psw2);
  52. myset.Close();
  53. return false; // return TRUE unless you set the focus to a control
  54. // EXCEPTION: OCX Property Pages should return FALSE
  55. }