#include "stdafx.h"
#include "图书管理系统.h"#include "DENGLU.h"
#include"BORROW.h"
#include"fstream.h"
#include"reader.h"#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#include"allow.h"
#endif/////////////////////////////////////////////////////////////////////////////
// DENGLU dialog DENGLU::DENGLU(CWnd* pParent /*=NULL*/)
: CDialog(DENGLU::IDD, pParent)
{
//{{AFX_DATA_INIT(DENGLU)
m_password = _T("");
m_ID = _T("");
//}}AFX_DATA_INIT
}
void DENGLU::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(DENGLU)
DDX_Text(pDX, IDC_PASSWORD, m_password);
DDX_Text(pDX, IDC_ID, m_ID);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(DENGLU, CDialog)
//{{AFX_MSG_MAP(DENGLU)
ON_BN_CLICKED(IDIN, OnIn)
ON_EN_CHANGE(IDC_ID, OnZHAO)
ON_EN_CHANGE(IDC_PASSWORD, OnMIMA)
ON_BN_CLICKED(IDC_GO, OnGo)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()void DENGLU::OnZHAO() 
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.

// TODO: Add your control notification handler code here

}void DENGLU::OnMIMA() 
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.

// TODO: Add your control notification handler code here

}void DENGLU::OnGo() {
 
this->UpdateData(true);

m_ID.TrimLeft();
if(m_ID.IsEmpty())
{
MessageBox("帐号不能为空!");
m_ID="";
m_password="";
this->UpdateData(false);
return;
} m_password.TrimLeft();
if(m_password.IsEmpty())
{
MessageBox("密码不能为空!");
m_ID="";
m_password="";
this->UpdateData(false);
return;
}
CString allowID,allowpassword;
::GetPrivateProfileString
("管理员信息","帐号","error",allowID.GetBuffer(20),20,".\\sys.ini");
::GetPrivateProfileString
("管理员信息","密码","error",allowpassword.GetBuffer(20),20,".\\sys.ini");
CString ID,password;
::GetPrivateProfileString
(m_ID,"帐号","error",ID.GetBuffer(20),20,".\\sys.ini");
::GetPrivateProfileString
(m_ID,"密码","error",password.GetBuffer(20),20,".\\sys.ini"); if((IsDlgButtonChecked(IDC_RADIO1))&&(m_ID==ID)
&&(m_password==password))//保存读者登陆信息用于查询、密码修改
{
::WritePrivateProfileString
("登陆信息","reader",m_ID,".\\sys.ini");
m_ID="";
m_password="";
this->UpdateData(false);
// Ac1 yh;
// yh.DoModal(); } else if((IsDlgButtonChecked(IDC_RADIO2))&&(m_ID==allowID)
&&(m_password==allowpassword))
{
m_ID="";
m_password="";
this->UpdateData(false);
BORROW bn;
bn.DoModal();
}
else
{
MessageBox("您输入的信息有误!");
m_ID="";
m_password="";
this->UpdateData(false);
return;
}
}

 

解决方案 »

  1.   

    只想说一点
    #include "图书管理系统.h" 
    用中文名字的头文件~?
    建议不要用~
    呵呵
      

  2.   

    只想说一点
    #include "图书管理系统.h" 
    用中文名字的头文件~?
    建议不要用~
    呵呵
      

  3.   


    error C2533: 'DENGLU::DENGLU' : constructors not allowed a return type
    error C2065: 'IDIN' : undeclared identifier;  1,构造函数不允许返回值,我想这是误报,一定是别的地方错了
    2,IDIN未定义,检查资源文件还有resource.h看看