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

📄 oldpassword.cpp

📁 visual c++ 实例编程
💻 CPP
字号:
// oldpassword.cpp : implementation file
//

#include "stdafx.h"
#include "作品.h"
#include "oldpassword.h"

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

/////////////////////////////////////////////////////////////////////////////
// Coldpassword dialog


Coldpassword::Coldpassword(CWnd* pParent /*=NULL*/)
	: CDialog(Coldpassword::IDD, pParent)
{
	//{{AFX_DATA_INIT(Coldpassword)
	m_oldpassword = _T("");
	//}}AFX_DATA_INIT
}


void Coldpassword::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(Coldpassword)
	DDX_Text(pDX, IDC_EDIT1, m_oldpassword);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(Coldpassword, CDialog)
	//{{AFX_MSG_MAP(Coldpassword)
	ON_WM_CREATE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// Coldpassword message handlers

void Coldpassword::OnOK() 
{
	// TODO: Add extra validation here
	UpdateData(true);
	if(m_oldpassword==oldpassword)
	{
		CDialog::OnOK();
	}
	else
		AfxMessageBox("密码错误!");
}

int Coldpassword::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CDialog::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	// TODO: Add your specialized creation code here
	CStdioFile file;
	file.Open("std.dat",CFile::modeRead|CFile::typeText,NULL);
	file.ReadString(oldpassword);
	file.Close();
	return 0;
}

⌨️ 快捷键说明

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