void CLMSDlg::OnButtonlogin() { // TODO: Add your control notification handler code here CMainsystem dlg; CADOConn adoconn; CString sqlstr,str; int countcleck; countcleck=((CComboBox*)GetDlgItem(IDC_COMBOCLECK))->GetCurSel(); ((CComboBox*)GetDlgItem(IDC_COMBOCLECK))->GetLBText(countcleck,str); UpdateData(TRUE); if(m_user.IsEmpty()) { MessageBox("用戶名不能為空","錯誤",MB_ICONERROR); GetDlgItem(IDC_EDITUSER)->SetFocus(); } try { sqlstr.Format("select *from usertable where uusername='%s' and uuserpassword='%s' and uusercleck='%s'",m_user,m_password,str); _bstr_t vSQL; vSQL=(_bstr_t)sqlstr; _RecordsetPtr m_recordset; m_recordset=adoconn.GetRecordSet(vSQL); CString str1,str2,str3; str1=(LPCSTR)(_bstr_t)(m_recordset->GetCollect("uusername")); str2=(LPCSTR)(_bstr_t)(m_recordset->GetCollect("uuserpassword")); str3=(LPCSTR)(_bstr_t)(m_recordset->GetCollect("uusercleck")); str1.TrimRight(); str2.TrimRight(); str3.TrimRight(); if(str1==m_user || str2==m_password || str3==str) { MessageBox("恭喜你,登錄成功!","正確",MB_ICONQUESTION); this->EndDialog(1); dlg.DoModal(); } } catch(...) { MessageBox("操作失敗","錯誤",MB_ICONERROR); m_user=""; m_password=""; GetDlgItem(IDC_EDITUSER)->SetFocus(); UpdateData(false); } }

鏈接:https://pan.baidu.com/s/1v5gm7n0L7TGyejCmQrMh2g 提取碼:x2p5
免費分享,但是X度限制嚴重,如若鏈接失效點擊鏈接或搜索加群 群號744933466,
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/86647.html
標籤:C++
上一篇:C++完全二叉樹的權值
