Ejemplo n.º 1
0
void CCountGen::OnBnClickedBtnSave()
{
	if (SaveParams() < 0)
	{
		return;
	}	
	PostMessage(WM_CLOSE,0,0);
}
Ejemplo n.º 2
0
RegFrame::~RegFrame()
{
	SaveParams();

	delete m_textCtrlBasic;
	delete m_textCtrlDR;
	delete m_textCtrlFPU;
	delete m_textCtrlMMX;
	delete m_textCtrl3dnow;
	delete m_bookCtrl;
	delete m_panel;
}
Ejemplo n.º 3
0
LRESULT CThumbEditor::OnClickedOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{
	/*Settings.ThumbSettings.FrameColor = FrameColor.GetColor();	
	Settings.ThumbSettings.ThumbColor1 = Color1.GetColor();
	Settings.ThumbSettings.ThumbColor2 = Color2.GetColor();	
	Settings.ThumbSettings.ThumbTextColor=ThumbTextColor.GetColor();
	Settings.ImageSettings.TextColor=TextColor.GetColor();
	Settings.ImageSettings.StrokeColor=StrokeColor.GetColor();*/

	SaveParams();
	//Settings.ThumbSettings.TextOverThumb = SendDlgItemMessage(IDC_TEXTOVERTHUMB2, BM_GETCHECK);
	EndDialog(wID);
	return 0;
}
Ejemplo n.º 4
0
void CGeneralCRC::OnSave()
{
	if (!UpdateData())
		return;

	// Get the name to save the settings under and check its valid
	CString strName;
	GetDlgItemText(IDC_CRC_NAME, strName);
	if (strName.IsEmpty())
	{
		TaskMessageBox("Invalid Name", "The CRC name cannot be empty");
		return;
	}
	else if (find_name(strName) != -1)
	{
		CString ss;
		ss.Format("The name \"%s\" is already being used.  "
			        "Please choose another name.", strName);
		TaskMessageBox("Name in Use", ss);
		return;
	}

	// Get the current settings to be associated with the name
	CString params = SaveParams();

	// Add the name to the end of the Select menu
	CMenu menu;
	menu.Attach(select_menu_.m_hMenu);
	menu.AppendMenu(MF_STRING, settings_.size(), strName);
	menu.Detach();

	// Add corresponding parameters to the end of settings_
	settings_.push_back(params);

	// Add to the registry (for next time the dialog is opened)
	HKEY hkey;
	if (::RegCreateKey(HKEY_CURRENT_USER, reg_locn, &hkey) == ERROR_SUCCESS)
	{
		::RegSetValueEx(hkey, strName, 0, REG_SZ, (BYTE *)params.GetBuffer(), params.GetLength()+1);
		::RegCloseKey(hkey);
	}

	// Disable Save button as we can't save again with the same name
	GetDlgItem(IDC_CRC_SAVE)->EnableWindow(FALSE);
}
Ejemplo n.º 5
0
void CCountGen::OnBnClickedButton1()
{
	CString strAcc="";
	CString strPwd="";
	CString strPhone = "";
	GetDlgItemText(IDC_EDIT_PICSAVENAME,strPhone);
	strPhone.Trim();
	if (strPhone == "")
	{
		MessageBox("每IP账号数不能为空,请一定填写!");
		return;
	}
	g_iFreshCount = atoi(strPhone);
	if (SaveParams() < 0)
	{
		return;
	}
	CString strRecommandPhone = "";
	int   lines   =   0;   
	CStdioFile   file;
	CString   cstr;
	CFileException   fe;
	CString strFilePath = "";
	char szFilter[]="Text files(*.txt)|*.txt";
	CFileDialog dlg(1,NULL,NULL,NULL,szFilter); 
	if(dlg.DoModal()==IDOK) 
	{
		strFilePath = dlg.GetPathName();
	}
	if (strFilePath=="")
	{
		return;
	}
	if(file.Open(strFilePath,CFile::modeRead,&fe))   
	{ 
		file.SeekToBegin();
		int idx1=0;
		int idx2=0;
		srand(time(NULL));
		while (file.ReadString(cstr))
		{
			cstr+=",";
			strAcc = "";
			strPwd = "";
			//strPhone = "";
			strRecommandPhone = "";
			idx2 =cstr.Find(",");
			if (idx2==-1)
			{
				continue;
			}
			strAcc = cstr.Left(idx2);
			cstr = cstr.Right(cstr.GetLength()-idx2-1);
			idx2 =cstr.Find(",");
			if (idx2==-1)
			{
				continue;
			}
			strPwd = cstr.Left(idx2);

			map<CString,int>::iterator it = m_mapOldAcc.find(strAcc+strPwd);
			if (it != m_mapOldAcc.end())
			{
				CString strShow = "";
				strShow.Format("%s,%s 已经对此账号做过处理",strAcc,strPwd);
				CUserMessagePump *pMsgPump = NULL;
				pMsgPump = CUserMessagePump::GetInstance();
				if (!pMsgPump)
				{
					return;
				}
				pMsgPump->AddToMessagePump(USERWINDOWMSG_1,strShow);
				continue;
			}
// 			cstr = cstr.Right(cstr.GetLength()-idx2-1);
// 			idx2 =cstr.Find(",");
// 			if (idx2==-1)
// 			{
// 				continue;
// 			}
			//strPhone = cstr.Left(idx2);
			//已经找到所有需要的数据
			if (strAcc !="" && strPwd != "" && strPhone != "")
			{
				int nCount = m_pList->GetItemCount();
				CString listIndex = "";
				int iIsExist = 0;
				for (int i=0;i<nCount;i++)
				{
					if (strAcc == m_pList->GetItemText(i,1) && strPwd == m_pList->GetItemText(i,2))
					{
						CString strShow = "";
						strShow.Format("%s,%s 重复导入",strAcc,strPwd);
						CUserMessagePump *pMsgPump = NULL;
						pMsgPump = CUserMessagePump::GetInstance();
						if (!pMsgPump)
						{
							return;
						}
						pMsgPump->AddToMessagePump(USERWINDOWMSG_1,strShow);
						iIsExist = 1;
						break;
					}
				}
				if (iIsExist == 1)
				{
					continue;
				}

				RegisterPack rgPack;
				rgPack.strAcc = strAcc;					//卡号
				rgPack.strPwd = strPwd;					//密码
				rgPack.strNickName = strPhone;			//充值账号

				AddRegisterPack(rgPack);
				nCount = m_pList->GetItemCount();
				listIndex.Format("%d",nCount);
				m_pList->InsertItem(nCount,"",0);
				m_pList->SetItemText(nCount,0,listIndex);
				m_pList->SetItemText(nCount,1,strAcc);
				m_pList->SetItemText(nCount,2,strPwd);							
			}
		}
		file.Close();
	}
	PostMessage(WM_CLOSE,0,0);
}
Ejemplo n.º 6
0
/*********************************
 *表示字母
 ?表示数字
 其他为0 (账号仅限用下划线,且不能在第一位)
 密码尽量采用数字加字母
****************************************/
int CCountGen::GenerateCounts()
{
	CString strAccType = "";
	CString strPwdType = "";
	CString strMailType = "";
	CString strTemp = "";
	CString strAcc = "";
	CString strPwd = "";
	CString strMail = "";
	CString strIntroMan = "";
	CString strIntroManEx = "";
	CString strNickNameEx = "";
	int generateNum = 0;	
	CString mailtype = "@china.com.cn";
	GetDlgItemText(IDC_EDIT_ACC,strAccType);
	GetDlgItemText(IDC_EDIT_PWD,strPwdType);
	GetDlgItemText(IDC_EDIT_MAILACC,strMailType);
	generateNum = GetDlgItemInt(IDC_EDIT_COUNTNUM);
	g_iShowWidth = GetDlgItemInt(IDC_EDIT_SHOWWIDTH);
	g_iShowHeight = GetDlgItemInt(IDC_EDIT_SHOWHEIGHT);
	GetDlgItemText(IDC_EDIT_INTROMAN,strIntroMan);
	strAccType.Trim();
	strPwdType.Trim();
	strMailType.Trim();
	strIntroMan.Trim();
	int iCheck = ((CButton*)GetDlgItem(IDC_CHECK_NAMEADD))->GetCheck();
	GetDlgItemText(IDC_EDIT_MAILTAIL,mailtype);
	CString strNickName = "";
	GetDlgItemText(IDC_EDIT_NICKNAME,strNickName);
	strNickName.Trim();
	mailtype.Trim();	
	//保存配置
	if (SaveParams() == -1)
	{
		return -1;
	}
	CString tempStr = "";		//临时变量
	srand(time(NULL));
	for (int i=0;i< generateNum;)
	{
		char inChar;
		char outChar;
		int iLen = 0;
		strAcc = "";
		strPwd = "";
		strMail = "";
		strIntroManEx = "";
		strNickNameEx = "";
		int j = 0;
		iLen = strIntroMan.GetLength();
		for (j=0;j<iLen;j++)		//身份证
		{
			inChar = strIntroMan.GetAt(j);
			outChar = RandChar(inChar);
			tempStr.Format("%c",outChar);
			strIntroManEx += tempStr;
		}
		strTemp.Format("%c",DoVerify(strIntroManEx));
		if (strTemp.MakeLower() =="x")
		{
			continue;
		}
		strIntroManEx += strTemp;

		iLen = strAccType.GetLength();
		for (j=0;j<iLen;j++)		//账号
		{
			inChar = strAccType.GetAt(j);
			outChar = RandChar(inChar);
			tempStr.Format("%c",outChar);
			strAcc += tempStr;
		}
		iLen = strPwdType.GetLength();
		for (j=0;j<iLen;j++)		//密码
		{

			inChar = strPwdType.GetAt(j);
			outChar = RandChar(inChar);
			tempStr.Format("%c",outChar);
			strPwd += tempStr;
		}
		iLen = strMailType.GetLength();
		for (j=0;j<iLen;j++)		//邮箱
		{

			inChar = strMailType.GetAt(j);
			outChar = RandChar(inChar);
			tempStr.Format("%c",outChar);
			strMail += tempStr;
		}
		strMail += mailtype;
		
		iLen = strNickName.GetLength();
		for (j=0;j<iLen;j++)		//邮箱
		{

			inChar = strNickName.GetAt(j);
			outChar = RandChar(inChar);
			tempStr.Format("%c",outChar);
			strNickNameEx += tempStr;
		}
		if (iCheck == 1)
		{
			strNickNameEx = strAcc + strNickNameEx;
		}		
		RegisterPack rgPack;
		rgPack.strAcc = strAcc;					//账号
		rgPack.strPwd = strPwd;					//密码
		rgPack.strMail = strMail;				//邮箱
		rgPack.strNickName = strNickNameEx;		//昵称
		rgPack.strIntroMan = strIntroManEx;		//身份证号
		AddRegisterPack(rgPack);
		int nCount = m_pList->GetItemCount();
		CString listIndex = "";
		listIndex.Format("%d",nCount);
		m_pList->InsertItem(nCount,"",0);
		m_pList->SetItemText(nCount,0,listIndex);
		m_pList->SetItemText(nCount,1,strAcc);
		m_pList->SetItemText(nCount,2,strPwd);
		m_pList->SetItemText(nCount,3,strMail);
		m_pList->SetItemText(nCount,4,strIntroManEx);
		m_pList->SetItemText(nCount,7,strNickNameEx);
		m_pList->SetItemText(nCount,8,"");
		i++;
	}
	return 0;
}
Ejemplo n.º 7
0
	CClientApp::~CClientApp()
	{
		A_MUTEX_DESTROY(&m_mtxQueue);

		SaveParams();
	}