本文整理汇总了C++中KIniFile::WriteString方法的典型用法代码示例。如果您正苦于以下问题:C++ KIniFile::WriteString方法的具体用法?C++ KIniFile::WriteString怎么用?C++ KIniFile::WriteString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KIniFile
的用法示例。
在下文中一共展示了KIniFile::WriteString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例2:
KUiFriendInterview::~KUiFriendInterview()
{
if (m_pFirstSelf == NULL)
{
KIniFile* pSetting = g_UiBase.GetPrivateSettingFile();
if (pSetting)
{
char szColor[16];
m_SelfTextColor.Color_dw = m_uLastTextColor;
sprintf(szColor, "%d,%d,%d", m_SelfTextColor.Color_b.r,
m_SelfTextColor.Color_b.g, m_SelfTextColor.Color_b.b);
pSetting->WriteString("UiConfig", "ChatColor", szColor);
g_UiBase.ClosePrivateSettingFile(true);
}
}
}
示例3: SavePrivateConfig
//--------------------------------------------------------------------------
// 功能:存储配置纪录
//--------------------------------------------------------------------------
int KUiBase::SavePrivateConfig()
{
if (m_UserAccountId[0] == 0)
return true;
KIniFile* pConfigFile = GetPrivateSettingFile();
if (pConfigFile)
{
pConfigFile->Clear();
pConfigFile->WriteString("Main", "Scheme", m_CurScheme);
//----逐个窗口保存配置设定----
KUiSkillTree::SaveConfig(pConfigFile);
KUiPlayerBar::SavePrivateSetting(pConfigFile);
KUiChatCentre::SavePrivateSetting(pConfigFile);
KShortcutKeyCentre::SavePrivateSetting(pConfigFile);
::SaveStallPrivateConfig(pConfigFile); //摆摊标价存盘
//----逐个窗口保存配置设定结束----
ClosePrivateSettingFile(true);
return true;
}
return false;
}