VC的1个简单问题

来源:百度知道 编辑:UC知道 时间:2024/05/31 10:22:24
DWORD CardSerial0=ReadPassword(0);
CardSerial0=CardSerial0%100000;
DWORD CardSerial1=ReadPassword(1);
CardSerial1=CardSerial1%100000;

if(CardSerial0==60026||CardSerial1==60026);
else
{
LogLogicException("You are not authorized\n");
::AfxMessageBox("You are not authorized",MB_OK,0);
return -1;
}

问题就是,如果不符合,我怎样将上面的2个序列号连在1快显示在弹出的窗口中?

CString str;
str.format("CardSerial0=%d CardSerial1=%d",CardSerial0, CardSerial1);
AfxMessageBox(str);

试下
MessageBox(hwnd,strcat(Password0,password1),"",MB_OK);
hwnd是你的程序的窗口,如果不知道或许也可以:
MessageBox(NULL,strcat(Password0,password1),"",MB_OK);