本文整理汇总了C++中KIniFile::WriteStruct方法的典型用法代码示例。如果您正苦于以下问题:C++ KIniFile::WriteStruct方法的具体用法?C++ KIniFile::WriteStruct怎么用?C++ KIniFile::WriteStruct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KIniFile
的用法示例。
在下文中一共展示了KIniFile::WriteStruct方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SaveLoginChoice
//--------------------------------------------------------------------------
// 功能:保存登陆选择设置
//--------------------------------------------------------------------------
void KLogin::SaveLoginChoice()
{
KIniFile* pSetting = g_UiBase.GetCommSettingFile();
int i;
if (pSetting)
{
//----纪录选择的服务器----
pSetting->WriteInteger($LOGIN, "SelServerRegion", m_Choices.nServerRegionIndex);
if (m_Choices.AccountServer.Title[0])
{
pSetting->WriteString($LOGIN, "LastGameServer", m_Choices.AccountServer.Title);
}
char szBuffer[32];
//----纪录最后一次登陆账号----
pSetting->EraseKey($LOGIN, $LAST_ACCOUNT);
if (m_Choices.bRememberAccount)
{
GetAccountPassword(szBuffer, NULL);
i = strlen(szBuffer);
EDOneTimePad_Encipher(szBuffer, i);
pSetting->WriteStruct($LOGIN, $LAST_ACCOUNT, szBuffer, sizeof(szBuffer));
if (m_Choices.bRememberAll)
{
KSG_PASSWORD Password;
GetAccountPassword(NULL, &Password);
i = strlen(Password.szPassword);
EDOneTimePad_Encipher(Password.szPassword, i);
pSetting->WriteStruct($LOGIN, $LAST_PASSWORD, Password.szPassword, sizeof(Password.szPassword));
}
KIniFile* pPrivate = g_UiBase.GetPrivateSettingFile();
if (pPrivate)
{
if (m_Choices.szProcessingRoleName[0])
{
i = strlen(m_Choices.szProcessingRoleName);
memcpy(szBuffer, m_Choices.szProcessingRoleName, i);
szBuffer[i] = 0;
EDOneTimePad_Encipher(szBuffer, i);
pPrivate->WriteString("Main", "LastSelCharacter", szBuffer);
}
g_UiBase.ClosePrivateSettingFile(true);
}
}
g_UiBase.CloseCommSettingFile(true);
}
}