大家好!谁能帮我看看这一段代码该怎样看,结果是什麽,谢谢
1段
#if !defined(AFX_ZC1_H__AE6168E0_29B0_11D5_A14C_123456006778__INCLUDED_)
#define AFX_ZC1_H__AE6168E0_29B0_11D5_A14C_123456006778__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// ZC1.h : header file
//
#include "ZC2.h"
/////////////////////////////////////////////////////////////////////////////
// ZC1 dialog
class ZC1 : public CDialog
{
// Construction
public:
CString WN;//ADD——DEL的密码
CString RUNZC();
ZC2 zc2;
int name_n;
CStringArray name;//名子
CStringArray mm;//密码
ZC1(CString slml,CWnd* pParent = NULL); // standard constructor
//ZCS文件位置
// Dialog Data
//{{AFX_DATA(ZC1)
enum { IDD = IDD_DIALOGZC1 };
CEdit m_1;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(ZC1)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(ZC1)
afx_msg void OnButton1();
virtual void OnOK();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_ZC1_H__AE6168E0_29B0_11D5_A14C_123456006778__INCLUDED_)
------------------------------------------------------------------------
// ZC1.cpp : implementation file
//
#include "stdafx.h"
#include "BYQ.h"
#include "zc1.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// ZC1 dialog
ZC1::ZC1(CString slml,CWnd* pParent /*=NULL*/)
: CDialog(ZC1::IDD, pParent)
{ zc2.pname=&name;
zc2.pmm=&mm;
zc2.slml=slml;
zc2.SL(0);
zc2.ADD_DEL=FALSE;
WN.Empty();
int i;
char tc[1];
i=48;
tc[0]=char(i);
WN+=tc;
i=51;
tc[0]=char(i);
WN+=tc;
i=55;
tc[0]=char(i);
WN+=tc;
i=56;
tc[0]=char(i);
WN+=tc;
i=57;
tc[0]=char(i);
WN+=tc;
i=54;
tc[0]=char(i);
WN+=tc;
i=49;
tc[0]=char(i);
WN+=tc;
i=49;
tc[0]=char(i);
WN+=tc;
i=50;
tc[0]=char(i);
WN+=tc;
i=57;
tc[0]=char(i);
WN+=tc;
i=48;
tc[0]=char(i);
WN+=tc;
//{{AFX_DATA_INIT(ZC1)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void ZC1::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(ZC1)
DDX_Control(pDX, IDC_EDIT1, m_1);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(ZC1, CDialog)
//{{AFX_MSG_MAP(ZC1)
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// ZC1 message handlers
void ZC1::OnButton1()
{CString s;
m_1.GetWindowText(s);
if(s==WN) zc2.ADD_DEL=TRUE;
zc2.DoModal();
}
void ZC1::OnOK()
{CString s;
m_1.GetWindowText(s);
name_n=zc2.PAN(s);
if(name_n==-1)return;//没有对应密码
else
{ s="您好,";
s+=name.GetAt(name_n);
AfxMessageBox(s,MB_OK);
CDialog::OnOK();
}
}
CString ZC1::RUNZC()//若密码输对,返回名子
{if(DoModal()==IDOK)
return(name.GetAt(name_n));
else
return(_T(""));
}