• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ TIniFile类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: TIniFile

void __fastcall TRigCtlMain::FormShow( TObject */*Sender*/ )
{
   TIniFile * t = new TIniFile( ".\\Configuration\\RigSelect.ini" );
   mfg = t->ReadString( "RigControl", "Manufacturer", "NoMfG" );
   model = t->ReadString( "RigControl", "Model", "NoMoDeL" );
   delete t;
   makeRPCObjects();
   XMPPInitialise( "RigCtl" );
   rig_load_all_backends();

   selected = -1;
   int status = rig_list_foreach( print_model_list, NULL );
   if ( status != RIG_OK )
   {
      char buff[ 1024 ];
      sprintf( buff, "rig_list_foreach: error = %s \n", rigerror( status ) );
      trace( buff );
   }
   RigCombo->Sorted = true;

   if ( selected != -1 )
   {
      RigCombo->ItemIndex = RigCombo->Items->IndexOfObject( ( TObject * ) selected );
      RigSelectButtonClick( this );
   }
   else
      RigCombo->ItemIndex = 0;
}
开发者ID:BackupTheBerlios,项目名称:minos-svn,代码行数:28,代码来源:ctlmain.cpp


示例2: Msclient

void* Msclient(void*)
{
	TIniFile tf;
	char tmp[256];	

    if (!tf.Open(INI_FILE_NAME))
    {
        printf("can not find\n");
        exit(-1000);
    }

    int marketnum = tf.ReadInt("COMMON","MARKETDATANUM",1);
	int i = 0;

	for(;i<marketnum;i++)
	{
		sprintf(tmp,"MARKETDATA%d",i+1);
		CUstpMs ustpMs;
        ustpMs.InitInstance(tmp,INI_FILE_NAME,&tradepanel);
	}
    while(false)
	{
		SLEEP_SECONDS(5000);
	}
    return 0;
}
开发者ID:wfay,项目名称:qtst,代码行数:26,代码来源:MsClient.cpp


示例3: TIniFile

//---------------------------------------------------------------------------
void __fastcall CTerminalRobotTyper::RestoreKeyInterval(){
   	TIniFile *ini = new TIniFile(GetCurrentDir() + "\\app.ini");
	int keyInterval = ini->ReadInteger(terminal->xmlConfig->TerminalID , "KeyboardInterval", terminal->panel->TrackBarKey->Position);
    delete ini;
	terminal->panel->TrackBarKey->Position =keyInterval;
    keyIntervalRestored =true;
}
开发者ID:limitee,项目名称:bot,代码行数:8,代码来源:TerminalRobotTyper.cpp


示例4: SaveSettings

//---------------------------------------------------------------------------
// Сохраняю установки измерения в файл
bool SaveSettings(MeasurInfo& measurInfo)
{
        if (access(lpIniFileName.c_str(), 0) == 0)
        {
        	//
        	TIniFile *Ini = new TIniFile(lpIniFileName);
        	//
        	try
		{
                	if (Ini->SectionExists("History"))
                	{
                		Ini->WriteInteger("History", "type_check_watt", measurInfo.type_check_watt);
                		Ini->WriteFloat("History", "begin_lw", measurInfo.begin_lw);
                		Ini->WriteFloat("History", "end_lw", measurInfo.end_lw);
                		Ini->WriteFloat("History", "step_lw", measurInfo.step_lw);
                                Ini->WriteFloat("History", "calc_lw", measurInfo.calc_lw);
                		Ini->WriteFloat("History", "time_accumulation", measurInfo.time_accumulation);
                		Ini->WriteBool("History", "makeKorK_bw", measurInfo.makeKorK_bw);
                		Ini->WriteBool("History", "makeKorK_cw", measurInfo.makeKorK_cw);
                		Ini->WriteBool("History", "makeSetZero", measurInfo.makeSetZero);
                                return true;
                        }
		}
        	__finally
		{
	        	delete Ini;
                	Ini = NULL;
		}
        }
开发者ID:madruslan,项目名称:MeasurSpectr,代码行数:31,代码来源:CreateMeasur.cpp


示例5: 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


示例6: TIniFile

// sets the default user settings
void PREFERENCES::SetDefaultSettings()
{
  TIniFile* storage = new TIniFile( ExtractFilePath( Application->ExeName ) + INIFILENAME_PREFERENCES );
  try
  {
    storage->WriteInteger( "Various", "DefaultUserLevel", UserLevel );
    #define WRITE_SCRIPT( name ) \
    if( !mCmdlineSpecified[ name ] ) \
      storage->WriteString( "Scripts", #name, Script[ name ] );
    WRITE_SCRIPT( AfterModulesConnected );
    WRITE_SCRIPT( OnExit );
    WRITE_SCRIPT( OnSetConfig );
    WRITE_SCRIPT( OnResume );
    WRITE_SCRIPT( OnSuspend );
    WRITE_SCRIPT( OnStart );

    #define WRITE_BUTTON( number ) \
    storage->WriteString( "Buttons", "Button" #number "Name", Buttons[ number ].Name ); \
    storage->WriteString( "Buttons", "Button" #number "Cmd", Buttons[ number ].Cmd );
    WRITE_BUTTON( 1 );
    WRITE_BUTTON( 2 );
    WRITE_BUTTON( 3 );
    WRITE_BUTTON( 4 );
  }
  catch(...) {}

  delete storage;
}
开发者ID:el-fran,项目名称:weka-bci2000,代码行数:29,代码来源:UPreferences.cpp


示例7: CheckPrefsInterOpt

//---------------------------------------------------------------------------
void __fastcall TPrefsForm::FormClose(TObject* Sender, TCloseAction& Action) {
  CheckPrefsInterOpt();
  CheckReadonlyOpt(PrefFileOpt);
  TIniFile* Ini = new TIniFile(PrefFileOpt);

  try {
    if (HotKeyComb->HotKey != 0)
      Ini->WriteBool("Options", "HotKeyEn", 1);
    else
      Ini->WriteBool("Options", "HotKeyEn", 0);
  } catch (...) {
    Application->MessageBoxA(LMessagesOpt.WritePrefsError, LMessagesOpt.Error, MB_OK + MB_ICONERROR);
  }

  delete Ini;

  if (NeedOnClose) {
    AnsiString StyleTx = StyleBox->Items->Strings[StyleIs];
    SNotesXMForm->TBXSwitcher1->Theme = StyleTx;
    SNotesXMForm->TBXSwitcher1->EnableXPStyles = WasXPEffects;
    SNotesXMForm->AllTabs->MultiLine = WasMultiLine;
    SNotesXMForm->CoolTray->IconVisible = WasTrayIcon;
    SNotesXMForm->AlphaBlend = WasTrans;
    SNotesXMForm->AlphaBlendValue = TransIs;

    if (WasTop)
      SNotesXMForm->AllTabs->TabPosition = tpTop;
    else
      SNotesXMForm->AllTabs->TabPosition = tpBottom;
  }
}
开发者ID:Chuvi-w,项目名称:cpp-labs,代码行数:32,代码来源:Prefers.cpp


示例8: TIniFile

//---------------------------------------------------------------------------
void __fastcall TDllTestForm::FormShow(TObject *Sender)
{
    TIniFile    *IniFile;

    if (!FInitialized) {
        FInitialized     = TRUE;
        IniFile          = new TIniFile(FIniFileName);
        Top              = IniFile->ReadInteger(SectionWindow, KeyTop,    Top);
        Left             = IniFile->ReadInteger(SectionWindow, KeyLeft,   Left);
        Width            = IniFile->ReadInteger(SectionWindow, KeyWidth,  Width);
        Height           = IniFile->ReadInteger(SectionWindow, KeyHeight, Height);
        delete IniFile;
        DisplayMemo->Clear();

		DllHandle = LoadLibraryA("OverbyteIcsDLL1.dll");
        if (DllHandle == 0) {
            MyMessageBox("OverbyteIcsDLL1.dll not found", "Error", MB_OK);
            Application->Terminate();
            return;
        }

        IcsDllDemo = (TIcsDllDemo)GetProcAddress(DllHandle, "IcsDllDemo");
        if (IcsDllDemo == NULL) {
            MyMessageBox("IcsDllDemo not found (OverbyteIcsDLL1.dll)", "Error", MB_OK);
            Application->Terminate();
            return;
        }
    }
}
开发者ID:KayvanGuo,项目名称:FTPRipper,代码行数:30,代码来源:OverbyteIcsDllTst1.cpp


示例9: TIniFile

void __fastcall TTestRigMain::FormShow( TObject */*Sender*/ )
{
   StartupTimer->Enabled = true;
   TIniFile * t = new TIniFile( ".\\Configuration\\RigSelect.ini" );
   mfg = t->ReadString( "TestRig", "Manufacturer", "NoMfG" );
   model = t->ReadString( "TestRig", "Model", "NoMoDeL" );
   delete t;
   rig_load_all_backends();

   selected = -1;
   int status = rig_list_foreach( print_model_list, NULL );
   if ( status != RIG_OK )
   {
      return ;
   }
   RigCombo->Sorted = true;

   if ( selected != -1 )
   {
      RigCombo->ItemIndex = RigCombo->Items->IndexOfObject( ( TObject * ) selected );
      RigSelectButtonClick( this );
   }
   else
      RigCombo->ItemIndex = 0;
}
开发者ID:BackupTheBerlios,项目名称:minos-svn,代码行数:25,代码来源:testrmain.cpp


示例10: while

//---------------------------------------------------------------------------
bool __fastcall CIniFile::SearchFile(AnsiString strBarCode,AnsiString &strFileName)
{
  WIN32_FIND_DATA FindFileData;
  AnsiString strName;
  char *pFileName;
  TIniFile *pIniFile;
  bool bResult=false;
  
  strName.sprintf("%s*.ini",IniFile_Dir);
  HANDLE hFile=FindFirstFile(strName.c_str(),&FindFileData);
  if(hFile!=INVALID_HANDLE_VALUE)
  {
    while(FindNextFile(hFile,&FindFileData)!=0)
    {
      pFileName=FindFileData.cFileName;
      strName.sprintf("%s%s",IniFile_Dir,pFileName);
      pIniFile = new TIniFile(strName);
      AnsiString strCode=pIniFile->ReadString(Product_Section,"BarCode","0000");
      delete pIniFile;
      if(strCode==strBarCode)
      {
        strFileName=strName;
        bResult=true;
        break;
      }
    }
    FindClose(hFile);
  }

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


示例11: LoadFormPos

//---------------------------------------------------------------------------
void __fastcall LoadFormPos(TForm *Form,
                            const AnsiString IniFileName,
                            const AnsiString SectionName,
                            const AnsiString KeyName)
{
    TIniFile   *IniFile;
    AnsiString sWindowPositions;

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

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

    // Formatage par défaut de la ligne de la section window
    sWindowPositions.SetLength(256);
    WindowPosToStr(sWindowPositions.c_str(), Form);

    // Get widow's position and size from ini file
    sWindowPositions = IniFile->ReadString(SectionName,
                                           KeyName,
                                           sWindowPositions);
    StrToWindowPos(sWindowPositions.c_str(), Form);

    // Destroy inifile object => close ini file
    IniFile->Free();
}
开发者ID:KayvanGuo,项目名称:FTPRipper,代码行数:28,代码来源:OverbyteIcsFormPos.cpp


示例12: 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


示例13: ExtractFilePath

void __fastcall TFrmMain::PopupMenu1Popup(TObject* Sender)
{
    if (OpenOk == true)
    {
        AnsiString  iniSetFile = ExtractFilePath(Application->ExeName) + "BcdEditer.ini";
        AnsiString SectionName = ExtractFileName(CurrentOpenFile);
        int ColType;
        TIniFile* ini;
        ini = new TIniFile(iniSetFile);
        ColType = ini->ReadInteger(SectionName, "ColType" + IntToStr(sgEdit->Col), 0);
        delete ini;
        switch (ColType)
        {
            case 0:
                btIntType->Checked = true;
                btFloatType->Checked = false;
                btTxtType->Checked = false;
                break;
            case 1:
                btIntType->Checked = false;
                btFloatType->Checked = true;
                btTxtType->Checked = false;
                break;
            case 2:
                btIntType->Checked = false;
                btFloatType->Checked = false;
                btTxtType->Checked = true;
                break;
            default:
                btIntType->Checked = true;
                btFloatType->Checked = false;
        }
    }
}
开发者ID:natedahl32,项目名称:portalclassic,代码行数:34,代码来源:dbcedit.cpp


示例14: TIniFile

//---------------------------------------------------------------------------
void __fastcall TFtpServerForm::SaveConfig(void)
{
    TIniFile *IniFile;

    IniFile = new TIniFile(FIniFileName);
    IniFile->WriteString(SectionData, KeyPort, FPort);
    IniFile->Free();
}
开发者ID:halaszk,项目名称:old-delphi-codes,代码行数:9,代码来源:FtpSrv1.cpp


示例15: TIniFile

//---------------------------------------------------------------------------
void __fastcall TForm1::ReadConfig ()    //读取配置
  {
    TIniFile *ini;
    ini = new TIniFile(ChangeFileExt(Application->ExeName,".INI "));
    Form1->Top = ini->ReadInteger( "Form ", "Top ", 100 );
    Form1->Left = ini->ReadInteger( "Form ", "Left ", 100 );
    AnsiString Caption =   ini->ReadString( "Form ", "Caption ", "科传接驳数据合规性检查程序" );
    Form1->Edit1->Text =  ini->ReadString( "Form ", "DefaultDir", "c:\\" );
    delete ini;
   }
开发者ID:rogertl,项目名称:cbuilder,代码行数:11,代码来源:Unit1.cpp


示例16: TIniFile

//---------------------------------------------------------------------------
void __fastcall TGetTrackThread::OpenDBDetecotr()
{
    if(!ShowReportEXE("TForm_DBDetecter",NULL))
    {
        TIniFile* ini = new TIniFile(ChangeFileExt( Application->ExeName, ".INI" ));        //free in next 2 line
        ini->WriteString("DBCHECK","DCH","false");
        delete ini;
    	ShellExecute(CallCenter_Main_Form, "open","DBDetector.exe", NULL, NULL, NULL);
    }
}
开发者ID:bravesheng,项目名称:bcb5-fms,代码行数:11,代码来源:GetTrackThread.cpp


示例17: TIniFile

void __fastcall TMainForm::FormCreate(TObject *Sender) {
    TIniFile *ini = new TIniFile(iniFile);
    try {
        fcPanel->Caption = ini->ReadString("FileName", "file-copy", curDir + "data\\C_wzl");
        cPanel->Caption = ini->ReadString("FileName", "cyclogram", curDir + "data\\CB_4z");
    }
    __finally {
        ini->Free();
        loadAndPrintAll();
    }
}
开发者ID:B-GangsteR,项目名称:opius,代码行数:11,代码来源:Main_Form_Unit.cpp


示例18: TIniFile

//---------------------------------------------------------------------------
void __fastcall TTcpSrvForm::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);
    delete IniFile;
}
开发者ID:halaszk,项目名称:old-delphi-codes,代码行数:12,代码来源:TcpSrv1.cpp


示例19: TIniFile

//---------------------------------------------------------------------------
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


示例20: 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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ TInlineComponentArray类代码示例发布时间:2022-05-31
下一篇:
C++ TInetAddr类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap