4 系统实现
4.1 登录模块
新建立一个类CUser继承于Cdialog,设计窗体如下,两个Edit控件,分别与类的变量m_username, m_password相关联,在用户点击确认后,触发OnOK函数,代码如下:
UpdateData();
CString strpassword;
int count = 0;
if(m_username == "")
{
AfxMessageBox("用户名不允许为空");
}
else
{
CADORecordset* pRs = new CADORecordset(((CRepairServiceApp*)AfxGetApp())->g_pDb);
CString sqlcommand="select pass_word from repairuser where user_name ='";
sqlcommand += m_username;
sqlcommand += "'";
if(pRs->Open((LPCTSTR)sqlcommand))
{
while(!pRs->IsEof())
{
|