The write logon module in the software is used to prevent malicious spread of the software. You can ignore logon during the internal test phase.
The main source code of the logon module is as follows:
void CLoginDlg::OnBnClickedBtnLogin(){// TODO: Add your control notification handler code hereCClerkDataSet lgDataSet;CString strSQL=L"";UpdateData(TRUE);CMFC_Library_RibbonView* pView;pView=((CMFC_Library_RibbonView*)((CMainFrame*)AfxGetMainWnd())->GetActiveView());if (m_strName.IsEmpty()){MessageBox(L"请输入用户名!",L"提示",MB_ICONWARNING);return;}else if(m_strPWD.IsEmpty()){MessageBox(L"请输入密码!",L"提示",MB_ICONWARNING);return;}strSQL=L"SELECT * FROM CLERK WHERE NAME=‘";strSQL=strSQL+m_strName;strSQL=strSQL+L"‘ AND PASSWORD=‘";strSQL=strSQL+m_strPWD;strSQL=strSQL+L"‘";if (!lgDataSet.Open(AFX_DB_USE_DEFAULT_TYPE,strSQL)){MessageBox(L"打开CLERK表失败!",L"提示",MB_ICONWARNING);return;} if (m_strName=="rong"&&m_strPWD=="123456"){m_strUSERID=lgDataSet.m_CLERK_ID;m_bSuccess=TRUE;MessageBox(L"登陆成功!",L"成功");pView->m_strUserId=m_strUSERID;pView->m_bLogin=m_bSuccess;pView->m_strUserName=m_strName;CString name=L"图书管理系统V1.0-当前登录用户:"+m_strName;((CMainFrame *)AfxGetApp()-> m_pMainWnd)->SetWindowText(name);Invalidate();CDialog::OnOK();DestroyWindow();}else{MessageBox(L"登录失败!用户名或密码不正确!",L"登录失败!",MB_ICONERROR);SetDlgItemText(IDC_EDIT_USERNAME,L"");SetDlgItemText(IDC_EDIT_PWD,L"");GetDlgItem(IDC_EDIT_USERNAME)->SetFocus();pView->m_strUserName=L"";pView->m_bLogin=m_bSuccess;pView->m_strUserId=L"";return;}}
This is the logon interface (ugly version ):
My personal blog address: http://ler.look.in
Ler-studio Official Website: http://studio.look.in
IDE development <ler-studio> (2): logon Module