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

📄 userchapas.cpp

📁 UG调用的动态链接数据库
💻 CPP
字号:
// UserChapas.cpp : implementation file
//

#include "stdafx.h"
#include "HiCut.h"
#include "UserChapas.h"
#include "Login.h"

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

/////////////////////////////////////////////////////////////////////////////
// CUserChapas dialog


CUserChapas::CUserChapas(CWnd* pParent /*=NULL*/)
	: CDialog(CUserChapas::IDD, pParent)
{
	//{{AFX_DATA_INIT(CUserChapas)
	m_pass0 = _T("");
	m_pass1 = _T("");
	m_pass2 = _T("");
	//}}AFX_DATA_INIT
}


void CUserChapas::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CUserChapas)
	DDX_Text(pDX, IDC_PASS0, m_pass0);
	DDX_Text(pDX, IDC_PASS1, m_pass1);
	DDX_Text(pDX, IDC_PASS2, m_pass2);
	//}}AFX_DATA_MAP
}


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

/////////////////////////////////////////////////////////////////////////////
// CUserChapas message handlers

void CUserChapas::OnOK() 
{
    UpdateData(TRUE);
	CDatabase m_database;
    CLogin *m_recordset = new CLogin(&m_database);
	m_recordset->Open(AFX_DB_USE_DEFAULT_TYPE,"[用户表]");
	////
	CString  m_user;
	extern CString m_login_user;
	m_user=m_login_user;
	for (m_recordset->MoveFirst();!m_recordset->IsEOF();m_recordset->MoveNext())
	{
		if(m_recordset->m_column1==m_user)
		{
			if(m_recordset->m_column1==m_user)
			{
			if(m_pass0==m_recordset->m_column2)
			{
			if(m_pass1==m_pass2)
			{
				m_recordset->Delete();
				m_recordset->AddNew();
				m_recordset->m_column1=m_user;
				m_recordset->m_column2=m_pass2;
				m_recordset->Update();
			}
			else
				MessageBox("输入错误");
			}
			}
		}		
		
	}
/////////////
	m_recordset->Close();
	m_database.Close();
	CDialog::OnOK();
}

BOOL CUserChapas::OnInitDialog() 
{
	CDialog::OnInitDialog();
		
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

⌨️ 快捷键说明

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