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=(
经验!C++核心技术 “登录实现”
最新推荐文章于 2022-05-05 18:45:57 发布
本文详细探讨了使用C++核心技术实现登录功能的过程,涵盖了用户验证、密码加密、会话管理等方面,深入讲解了C++在网络安全和用户认证中的应用。通过实例代码,解析关键步骤和技巧,助你提升C++编程能力。
摘要由CSDN通过智能技术生成