Void CRegisterDlg: : OnOK ()
{
The user the users;
The UpdateData ();
The FILE * fp.
Fp=fopen (" usr. TXT ", "wb");
GetDlgItem (IDC_EDIT1) - & gt; GetWindowText (m_new_username);
If (STRCMP (m_new_username, users name)==0)
{
MessageBox (" user name already exists ");
}
The else
{
Strcpy (the users name, m_new_username);
GetDlgItem (IDC_EDIT3) - & gt; GetWindowText (m_new_password);
GetDlgItem (IDC_EDIT4) - & gt; GetWindowText (m_confirm_password);
If (STRCMP (m_new_password, m_confirm_password)==0)
{
Strcpy (users. Passwd, m_new_password);
Fwrite ((void *) & amp; The users, sizeof (user), 1, fp);
fclose(fp);
MessageBox (" registration ");
CDialog: : OnOK ();
}
The else
{
MessageBox (" two input password is not the same as ");
}
}
}