当前位置: 首页>>代码示例>>C++>>正文


C++ IAccount::SetPassword方法代码示例

本文整理汇总了C++中IAccount::SetPassword方法的典型用法代码示例。如果您正苦于以下问题:C++ IAccount::SetPassword方法的具体用法?C++ IAccount::SetPassword怎么用?C++ IAccount::SetPassword使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IAccount的用法示例。


在下文中一共展示了IAccount::SetPassword方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnBnClickedBtOk

void CTradeLockDlg::OnBnClickedBtOk()
{
	// TODO: Add your control notification handler code here
	CString sTmp;
	m_edPsw.GetWindowText(sTmp);
	//IAccount* pAccount = m_pAccountMng->GetCurrentAccount(atTrade);
	int nIndex = m_cbFundAccount.GetCurSel();
	IAccount* pAccount = (IAccount*)m_cbFundAccount.GetItemDataPtr(nIndex);
	if (pAccount->GetConnectHandle() == 0)
	{
		pAccount->SetPassword(sTmp);
		if(pAccount->Login(sTmp))
		{
			pAccount->SetIsLocked(FALSE);
			this->GetLayoutWindow()->OpenLayout(CURRENT_LAYOUT_TARGET,LN_TRADINGPANEL,PUBLIC_OWNER);
			m_pAccountMng->SetCurrentAccount(pAccount);
		}
		else
			MessageBox(sTmp, "提示", MB_ICONINFORMATION);
	}
	else
	{
		if (pAccount->GetPassword() == sTmp)
		{
			pAccount->SetIsLocked(FALSE);
			this->GetLayoutWindow()->OpenLayout(CURRENT_LAYOUT_TARGET,LN_TRADINGPANEL,PUBLIC_OWNER);
			m_pAccountMng->SetCurrentAccount(pAccount);
		}
		else
		{
			MessageBox("密码错误!", "提示", MB_ICONINFORMATION);
			m_edPsw.SetFocus();
			m_edPsw.SetSel(0, -1);
		}
	}
	
}
开发者ID:hefen1,项目名称:XCaimi,代码行数:37,代码来源:TradeLockDlg.cpp

示例2: LoginLevel

BOOL CDlgLevelInput::LoginLevel(const CString &strAccName, const CString &strAccPwd)
{
	CString strUserAcc(""), strPwd("");
	if (strAccName.IsEmpty() || strAccPwd.IsEmpty())
	{
		EnableInput(FALSE);
		CString strText;
		CString strTitle;
		strTitle.LoadString(IDS_STRING_Error);
		//////////////////////////////////////////////////////////////////////////
		// 获取账号、密码
		
		GetDlgItem(IDC_EDIT_SHACC)->GetWindowText(strUserAcc);
		if (strUserAcc.IsEmpty())
		{
			strText.LoadString(IDS_STRING_AccountError);
			MessageBox(strText,strTitle);
			EnableInput(TRUE);
			GetDlgItem(IDC_EDIT_SHACC)->SetFocus();
			return FALSE;
		}
		strPwd = m_sEdit.GetRealText();
		if (strPwd.IsEmpty())
		{
			strText.LoadString(IDS_STRING_PasswardError);
			MessageBox(strText,strTitle);
			EnableInput(TRUE);
			m_sEdit.SetFocus();
			return FALSE;
		}
	}
	else
	{
		strUserAcc = strAccName;
		strPwd = strAccPwd;
	}
	long handle = g_pDoLogin->ConnectServer(CEV_Connect_LEVEL2);
	if (handle)
	{// level2服务连接成功 

		IAccountMng *pTradeAccountMng = g_pDoLogin->m_pTradeCore->GetAccountMng();
		if(pTradeAccountMng && pTradeAccountMng->GetCount(atLevel2) == 0)
		{
			//IAccount* pQHAccount = pTradeAccountMng->Add(atLevel2);
			IAccount* pQHAccount = pTradeAccountMng->NewAccount(atLevel2);
			if(pQHAccount)
			{
				pQHAccount->SetLoginAccount(strUserAcc);
				pQHAccount->SetCellNo("");
				pQHAccount->SetLoginAccountType("");
				pQHAccount->SetPassword(strPwd);
				pQHAccount->SetServerID(0);
				pQHAccount->SetBranchNo("0");
				pQHAccount->SetConnectHandle(handle);
				CString sMsg = "";
				if( pQHAccount->Login(sMsg) )
				{
					pTradeAccountMng->Add(pQHAccount);
					pTradeAccountMng->SetCurrentAccount(pQHAccount);
					return TRUE;
				}
				else
				{
					pQHAccount->Release();
					//pTradeAccountMng->DeleteAccount(pQHAccount);
// 					CDataSourceInitDataStauts msg;
// 					strncpy(msg.m_szMsg, sMsg, min(sMsg.GetLength()+1, 256));
// 					FSetProgressMsg(&msg);
					MessageBox(sMsg, "Error", MB_OK | MB_ICONERROR);
				}
			}
		}
	}
	EnableInput(TRUE);
	return TRUE;
}
开发者ID:hefen1,项目名称:XCaimi,代码行数:76,代码来源:DlgLevelInput.cpp

示例3: addAccount

	void AccountsSettings::addAccount (QObjectList accObjects)
	{
		IBookmarksService *ibs = qobject_cast<IBookmarksService*> (sender ());
		if (!ibs)
		{
			qWarning () << Q_FUNC_INFO
					<< sender ()
					<< "ins't IBookmarksService";
			return;
		}

		QObjectList accounts;
		Q_FOREACH (QObject *accObj, accObjects)
		{
			IAccount *account = qobject_cast<IAccount*> (accObj);
			if (Id2Account_.contains (account->GetAccountID ()))
				continue;

			if (!account->GetPassword ().isEmpty ())
				Core::Instance ().SavePassword (accObj);
			else
				account->SetPassword (Core::Instance ().GetPassword (accObj));

			Id2Account_ [account->GetAccountID ()] = accObj;

			accounts << accObj;

			const QModelIndex& index = GetServiceIndex (ibs->GetObject ());
			QStandardItem *parentItem = 0;
			if (!index.isValid ())
			{
				parentItem = new QStandardItem (ibs->GetServiceIcon (), ibs->GetServiceName ());
				parentItem->setEditable (false);
				Item2Service_ [parentItem] = ibs;
				AccountsModel_->appendRow (parentItem);
			}
			else
				parentItem = AccountsModel_->itemFromIndex (index);

			QList<QStandardItem*> record;
			QStandardItem *item = new QStandardItem (account->GetLogin ());
			item->setEditable (false);
			item->setCheckable (true);
			item->setCheckState (account->IsSyncing () ? Qt::Checked : Qt::Unchecked);

			if (account->IsSyncing ())
			{
				Core::Instance ().AddActiveAccount (accObj);
				IBookmarksService *ibs = qobject_cast<IBookmarksService*> (account->GetParentService ());
				ibs->DownloadBookmarks (account->GetObject (), account->GetLastDownloadDateTime ());
				ibs->UploadBookmarks (account->GetObject (), Core::Instance ().GetAllBookmarks ());
			}

			Item2Account_ [item] = account;

			QStandardItem *uploaditem = new QStandardItem (account->GetLastUploadDateTime ()
					.toString (Qt::DefaultLocaleShortDate));
			uploaditem->setEditable (false);

			QStandardItem *downloaditem = new QStandardItem (account->GetLastDownloadDateTime ()
					.toString (Qt::DefaultLocaleShortDate));
			uploaditem->setEditable (false);

			record << item
					<< uploaditem
					<< downloaditem;
			parentItem->appendRow (record);

			if (account->IsSyncing ())
				Core::Instance ().AddActiveAccount (accObj);

			Ui_.AccountsView_->expandAll ();

			Scheduled_ = false;
			ScheduleResize ();
		}
开发者ID:Akon32,项目名称:leechcraft,代码行数:76,代码来源:accountssettings.cpp


注:本文中的IAccount::SetPassword方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。