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


C++ TIniFile::WriteString方法代码示例

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


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

示例1: FormClose

//---------------------------------------------------------------------------
void __fastcall THttpTestForm::FormClose(TObject *Sender, TCloseAction &Action)
{
    TIniFile *IniFile;

    IniFile = new TIniFile(FIniFileName);
    IniFile->WriteInteger(SectionWindow, KeyTop,         Top);
    IniFile->WriteInteger(SectionWindow, KeyLeft,        Left);
    IniFile->WriteInteger(SectionWindow, KeyWidth,       Width);
    IniFile->WriteInteger(SectionWindow, KeyHeight,      Height);
    IniFile->WriteString(SectionData,    KeyUrl,         URLEdit->Text);
    IniFile->WriteString(SectionData,    KeySocksServer, SocksServerEdit->Text);
    IniFile->WriteString(SectionData,    KeySocksPort,   SocksPortEdit->Text);
    IniFile->WriteString(SectionData,    KeyProxyHost,   ProxyHostEdit->Text);
    IniFile->WriteString(SectionData,    KeyProxyPort,   ProxyPortEdit->Text);
    IniFile->WriteBool(SectionData,      KeyVerifyPeer,  VerifyPeerCheckBox->Checked);
    IniFile->WriteString(SectionData,    KeyDoc,         DocEdit->Text);
    IniFile->WriteString(SectionData,    KeyCertFile,    CertFileEdit->Text);
    IniFile->WriteString(SectionData,    KeyPrivKeyFile, PrivKeyFileEdit->Text);
    IniFile->WriteString(SectionData,    KeyPassPhrase,  PassPhraseEdit->Text);
    IniFile->WriteString(SectionData,    KeyCAFile,      CAFileEdit->Text);
    IniFile->WriteString(SectionData,    KeyCAPath,      CAPathEdit->Text);
    IniFile->WriteString(SectionData,    KeyAcceptableHosts, AcceptableHostsEdit->Text);
    IniFile->WriteInteger(SectionData,   KeySocksLevel,  SocksLevelComboBox->ItemIndex);
    IniFile->WriteInteger(SectionData,   KeyHttpVer,     HttpVersionComboBox->ItemIndex);
    IniFile->WriteBool(SectionData,      KeySessCache,   SessCacheCheckBox->Checked);
    IniFile->WriteBool(SectionData,      KeyDebugEvent,  DebugEventCheckBox->Checked);
    IniFile->WriteBool(SectionData,      KeyDebugOutput, DebugOutputCheckBox->Checked);
    IniFile->WriteBool(SectionData,      KeyDebugFile,   DebugFileCheckBox->Checked);
    delete IniFile;
}
开发者ID:KayvanGuo,项目名称:FTPRipper,代码行数:31,代码来源:OverbyteIcsHttpsTst1.cpp

示例2: StoreHistory

//---------------------------------------------------------------------------
void __fastcall CIniFile::StoreHistory(int nYear,int nMonth,int nDate,AnsiString strMessage)
{
  AnsiString strFileName;
  TIniFile *pIniFile;
  int nFileMonth,nIndex; 

  strFileName.sprintf("%s\\Message History\\%4d_%02d_%02d.ini",IniFile_Dir,nYear,nMonth,nDate);
  pIniFile = new TIniFile(strFileName);

  nFileMonth=pIniFile->ReadInteger("Control","Month",1);
  nIndex=pIniFile->ReadInteger("Control","Index",1);

  if(nFileMonth!=nMonth)
  {
    nIndex=1;
    pIniFile->WriteInteger("Control","Month",nMonth);
  }

  AnsiString strID;
  strID.sprintf("No%08d",nIndex);
  pIniFile->WriteString("History",strID,strMessage);

  nIndex++;

  strID.sprintf("No%08d",nIndex);
  pIniFile->WriteString("History",strID,"//-------------以下做作廢--------------------//");

  pIniFile->WriteInteger("Control","Index",nIndex);

  delete pIniFile;
}
开发者ID:Raxtion,项目名称:CT82,代码行数:32,代码来源:IniFile.cpp

示例3: SaveToFile

void TSettings::SaveToFile() {
    TSettings *Settings = TSettings::Instance();
    TIniFile *ini = new TIniFile(".\\settings.cfg");

    ini->WriteBool("Global", "FullScreen", Settings->Fullscreen);
    ini->WriteInteger("Global", "Width", Settings->FormsWidth);
    ini->WriteInteger("Global", "Height", Settings->FormsHeight);
    ini->WriteInteger("Global", "Left", Settings->FormsLeft);
    ini->WriteInteger("Global", "Top", Settings->FormsTop);
    ini->WriteBool("Global", "Sound", Settings->SoundEnabled);
    ini->WriteInteger("Global", "SoundVolume", Settings->SoundVolume);
    ini->WriteBool("Global", "Music", Settings->MusicEnabled);
    ini->WriteInteger("Global", "MusicVolume", Settings->MusicVolume);
    ini->WriteBool("Global", "HostMode", Settings->HostMode);
    ini->WriteString("Global", "LastBase", Settings->LastBase);

    for (int i = 1; i <= 5; i++) {
        ini->WriteString("Players", "Player" + IntToStr(i), Settings->PlayerNames[i - 1]);
        ini->WriteInteger("Players", "PlayerType" + IntToStr(i), (int) Settings->PlayerType[i - 1]);
    }

    int i = 0;
    for (std::map <String, String> ::iterator it = BaseFiles.begin(); it != BaseFiles.end(); ++it) {
        ini->WriteString("Bases", "basename" + IntToStr(i), it->first);
        ini->WriteString("Bases", "base" + IntToStr(i), ExtractFileName(it->second));
        ++i;
    }
    ini->Free();

}
开发者ID:SQReder,项目名称:RussianRoulette,代码行数:30,代码来源:settings_impl.cpp

示例4: SaveParam

void __fastcall TFormMain::SaveParam() {
	TIniFile *ini = new TIniFile(ExtractFilePath(Application->ExeName) + PARAM_FILE);
	ini->WriteString("ftp", "Host", this->Crypt(this->EditHost->Text));
	ini->WriteString("ftp", "Login", this->Crypt(this->EditLogin->Text));
	ini->WriteString("ftp", "Password", this->Crypt(this->EditPassword->Text));
	ini->WriteString("ftp", "Port", this->Crypt(this->EditPort->Text));
	ini->WriteString("ftp", "Pwd", this->Crypt(this->EditPwd->Text));
	ini->Free();
}
开发者ID:alex-rassanov,项目名称:screenshoot,代码行数:9,代码来源:Unit1.cpp

示例5: TIniFile

//---------------------------------------------------------------------------
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
    TIniFile *ini;
    ini = new TIniFile(ChangeFileExt( Application->ExeName, ".INI " ) );
    ini->WriteInteger( "Form ", "Top ", Top );
    ini->WriteInteger( "Form ", "Left ", Left );
    ini->WriteString ( "Form ", "Caption ", Caption );
    ini->WriteString ( "Form ", "DefaultDir ", Edit1->Text );
    delete ini;        
}
开发者ID:rogertl,项目名称:cbuilder,代码行数:11,代码来源:Unit1.cpp

示例6: StoreHistoryNew

//---------------------------------------------------------------------------
void __fastcall CIniFile::StoreHistoryNew()
{
  AnsiString strFileName;
  TIniFile *pIniFile;
  int nFileMonth,nIndex;
  time_t timer;
  struct tm *tblock;

  int nSize=m_vecMsg.size();
  if(nSize==0) return;

  AnsiString strMsg;
  strMsg.sprintf("訊息共有 %d 筆\n每筆花費時間約 10 ms\n是否要儲存訊息??",nSize);
  if(Application->MessageBoxA(strMsg.c_str(),"Confirm",MB_ICONQUESTION|MB_OKCANCEL)!=IDOK) return;

   /* gets time of day */
   timer = time(NULL);
   /* converts date/time to a structure */
   tblock = localtime(&timer);
   int nMonth=tblock->tm_mon;
   int nDate=tblock->tm_mday;

  strFileName.sprintf("%s\\Message History\\%d.ini",IniFile_Dir,nDate);
  pIniFile = new TIniFile(strFileName);

  nFileMonth=pIniFile->ReadInteger("Control","Month",1);
  nIndex=pIniFile->ReadInteger("Control","Index",1);

  if(nFileMonth!=nMonth)
  {
    DeleteFile(strFileName);
    nIndex=1;
    pIniFile->WriteInteger("Control","Month",nMonth);
  }

  AnsiString strID;

  for(int nSz=0;nSz<nSize;nSz++)
  {
    strID.sprintf("No%08d",nIndex);
    pIniFile->WriteString("History",strID,m_vecMsg[nSz]);

    nIndex++;
  }
 
  m_vecMsg.clear();
  
  strID.sprintf("No%08d",nIndex);
  pIniFile->WriteString("History",strID,"//-------------以下做作廢--------------------//");

  pIniFile->WriteInteger("Control","Index",nIndex);

  delete pIniFile;
}
开发者ID:Raxtion,项目名称:CT82,代码行数:55,代码来源:IniFile.cpp

示例7: TIniFile

//---------------------------------------------------------------------------
void __fastcall TPOP3ExcercizerForm::FormCloseQuery(
    TObject *Sender, bool &CanClose)
{
    TIniFile *IniFile;

    IniFile = new TIniFile(IniFileName);
    IniFile->WriteString("Data", "Host",     HostEdit->Text);
    IniFile->WriteString("Data", "Port",     PortEdit->Text);
    IniFile->WriteString("Data", "UserName", UserNameEdit->Text);
    IniFile->WriteString("Data", "Password", PassWordEdit->Text);
    delete IniFile;
}
开发者ID:halaszk,项目名称:old-delphi-codes,代码行数:13,代码来源:MailRcv1.cpp

示例8: FormClose

//---------------------------------------------------------------------------
void __fastcall THttpTestForm::FormClose(TObject *Sender, TCloseAction &Action)
{
    TIniFile *IniFile;

    IniFile = new TIniFile(FIniFileName);
    IniFile->WriteString("Data", "URL",       URLEdit->Text);
    IniFile->WriteString("Data", "ProxyHost", ProxyHostEdit->Text);
    IniFile->WriteString("Data", "ProxyPort", ProxyPortEdit->Text);
    IniFile->WriteString("Data", "Data",      DataEdit->Text);
    IniFile->WriteString("Data", "DateTime",  DateTimeEdit->Text);
    delete IniFile;
}
开发者ID:KayvanGuo,项目名称:FTPRipper,代码行数:13,代码来源:OverbyteIcsHttpTst1.cpp

示例9: FormCloseQuery

//---------------------------------------------------------------------------
void __fastcall TMainForm::FormCloseQuery(TObject *Sender, bool &CanClose)
{
    TIniFile *IniFile;  

    IniFile = new TIniFile(FIniFileName);
    IniFile->WriteInteger(SectionWindow, KeyTop,    Top);
    IniFile->WriteInteger(SectionWindow, KeyLeft,   Left);
    IniFile->WriteInteger(SectionWindow, KeyWidth,  Width);
    IniFile->WriteInteger(SectionWindow, KeyHeight, Height);
    IniFile->WriteString(SectionData, KeyPort,   PortEdit->Text);
    IniFile->WriteString(SectionData, KeyServer, ServerEdit->Text);
    delete IniFile;
}
开发者ID:KayvanGuo,项目名称:FTPRipper,代码行数:14,代码来源:OverbyteIcsUdpLstn1.cpp

示例10: FormDestroy

void __fastcall TMainForm::FormDestroy(TObject *Sender) {
    if( !isCorrect ) // если выбраные файлы не открылись, не нужно их сохранять в .ini
        return;

    TIniFile *ini = new TIniFile(iniFile);
    try {
        ini->WriteString( "FileName", "file-copy", fcPanel->Caption );
        ini->WriteString( "FileName", "cyclogram", cPanel->Caption );
    }
    __finally {
        ini->Free();
        clearAll();
    }
}
开发者ID:B-GangsteR,项目名称:opius,代码行数:14,代码来源:Main_Form_Unit.cpp

示例11: FormClose

//---------------------------------------------------------------------------
void __fastcall THttpTestForm::FormClose(TObject *Sender, TCloseAction &Action)
{
    TIniFile *IniFile;

    IniFile = new TIniFile(FIniFileName);
    IniFile->WriteString(SectionData, KeyUserID,    UserIDEdit->Text);
    IniFile->WriteString(SectionData, KeyProxy,     ProxyEdit->Text);
    IniFile->WriteString(SectionData, KeyMessage,   MessageEdit->Text);
    IniFile->WriteString(SectionData, KeyEMail,     EMailEdit->Text);
    IniFile->WriteInteger(SectionWindow, KeyTop,    Top);
    IniFile->WriteInteger(SectionWindow, KeyLeft,   Left);
    IniFile->WriteInteger(SectionWindow, KeyWidth,  Width);
    IniFile->WriteInteger(SectionWindow, KeyHeight, Height);
    delete IniFile;
}
开发者ID:halaszk,项目名称:old-delphi-codes,代码行数:16,代码来源:httppg1.cpp

示例12: FormClose

//---------------------------------------------------------------------------
void __fastcall TClientForm::FormClose(TObject *Sender,
      TCloseAction &Action)
{
    TIniFile *IniFile;

    IniFile = new TIniFile(IniFileName);
    IniFile->WriteInteger("Window", "Top",    Top);
    IniFile->WriteInteger("Window", "Left",   Left);
    IniFile->WriteInteger("Window", "Width",  Width);
    IniFile->WriteInteger("Window", "Height", Height);
    IniFile->WriteString("Data", "Server",  ServerEdit->Text);
    IniFile->WriteString("Data", "Port",    PortEdit->Text);
    IniFile->WriteString("Data", "Command", SendEdit->Text);
    delete IniFile;
}
开发者ID:diemsi,项目名称:czadownik,代码行数:16,代码来源:CliDemo1.cpp

示例13: test_and_go_butClick

void __fastcall TFastConfigForm::test_and_go_butClick(TObject *Sender) {
	db_prop.host  = db_host_edit->Text;
	db_prop.name  = db_name_edit->Text;
	db_prop.user  = db_user_edit->Text;
	db_prop.pass  = db_pass_edit->Text;
	tables_prefix = db_prf_edit->Text;

	TIniFile *inifile = new TIniFile(config_ini_path);
	inifile->WriteString("DB Connection Properties", "HostName", db_prop.host);
	inifile->WriteString("DB Connection Properties", "Database", db_prop.name);
	inifile->WriteString("DB Connection Properties", "User_Name", db_prop.user);
	inifile->WriteString("DB Connection Properties", "Password", db_prop.pass);
	inifile->WriteString("DB Connection Properties", "Prefix", tables_prefix);
	delete inifile;
}
开发者ID:PaulAnnekov,项目名称:commfort-webchat,代码行数:15,代码来源:first_config_form.cpp

示例14: SaveFormPos

//---------------------------------------------------------------------------
void __fastcall SaveFormPos(TForm *Form,
                            const AnsiString IniFileName,
                            const AnsiString SectionName,
                            const AnsiString KeyName)
{
    TIniFile     *IniFile;
    TWindowState WindowState;
    char         Buffer[256];

    if (IniFileName.Length() == 0)
        return;

    // Create inifile object => Open ini file
    IniFile = new TIniFile(IniFileName);

    WindowState = Form->WindowState;

    // If window minimized or maximized, restore to normal state
    if (Form->WindowState != wsNormal)
        Form->WindowState = wsNormal;

    // Save the window's postion and size to the ini file
    IniFile->WriteString(SectionName,
                         KeyName,
                         WindowPosToStr(Buffer, Form));

    // Destroy inifile object => close ini file
    IniFile->Free();

    Form->WindowState = WindowState;
}
开发者ID:KayvanGuo,项目名称:FTPRipper,代码行数:32,代码来源:OverbyteIcsFormPos.cpp

示例15: TIniFile

//---------------------------------------------------------------------------
void __fastcall TForm1::CodeBtnClick(TObject *Sender)
{
  TCode Work;
  String S = "";
  // ask for code
  if (InputQuery("Usage Code Entry", "Enter the code", S)) {
    TIniFile* Ini = new TIniFile("ONGUARD.INI");
    try {
      // store the usage code in the ini file if it looks OK
      if (HexToBuffer(S, &Work, sizeof(Work))) {
        // save the value
        Ini->WriteString("Codes", "UsageCode", S);
        CodeLbl->Caption = S;

        // tell the code component to test the new code, reporting the results
        OgUsageCode1->CheckCode(true);
      }
    }
    catch (...) {
    	delete Ini;
      Ini = 0;
    }
		delete Ini;
  }
}
开发者ID:chinnyannieb,项目名称:Meus-Projetos,代码行数:26,代码来源:EXUSREGU.cpp


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