送分!帮找错误!!!
lphy 2003-04-10 03:19:29 BOOL OnFind(CString m_StrA, CString m_StrB,CString m_StrC)
{
BOOL flag=false;
CDatabase db;
CNewSet *lphy_pSet=NULL;
if(db.Open("NewInformation"))
{
lphy_pSet=new CNewSet();
lphy_pSet->Open();
lphy_pSet->MoveFirst();
while(!lphy_pSet->IsEOF())
{
if(lphy_pSet->m_CardNumber==m_StrA&&lphy_pSet->m_Password==m_StrB)
{
CString time=lphy_pSet->m_LeftTime;
int ti=atoi(time);
if(ti>5)
{
flag=true;
break;
}
else
{
flag=false;
break;
}
}
else
lphy_pSet->MoveNext();
}
}
lphy_pSet->Close();
delete lphy_pSet;
db.Close();
if(flag)
{
CListCtrl* pList=(CListCtrl*)AfxGetMainWnd()->GetDlgItem(IDC_LIST);//得到指针
CString SystemTime;//他对应从系统得到的时间
SYSTEMTIME sysTime;
GetLocalTime(&sysTime);
SystemTime.Format("%d:%d",sysTime.wHour,sysTime.wMinute);
pList->InsertItem(0,(LPCTSTR)m_StrC,0);
pList->SetItemText(0,1,(LPCTSTR)m_StrA);
pList->SetItemText(0,2,"0");
pList->SetItemText(0,3,(LPCTSTR)SystemTime);
pList->SetItemText(0,4,(LPCTSTR)lphy_pSet->m_LeftTime);
}
return flag;
}