BOOL GetSerialNo(HWND hDlg)
{
int i;
TCHAR szUserName[16];
GetDlgItemText(hDlg, IDC_USERNAME, szUserName, 16);
if(_tcslen(szUserName) == 0)
return FALSE;
g_UserVal = GetUserValue(szUserName);
memset(g_UserBits, 0, sizeof(g_UserBits));
InitUserBits();
g_Top = 0;
for(i = 9; i >= 1; i--)
SetBit(i, 0);
//字符串的 null-terminator;
g_SerialNo[g_Top] = 0;
++g_Top;
SetDlgItemText(hDlg, IDC_SERIALNO, g_SerialNo);
}