本文整理汇总了C++中TIniFile::ReadInteger方法的典型用法代码示例。如果您正苦于以下问题:C++ TIniFile::ReadInteger方法的具体用法?C++ TIniFile::ReadInteger怎么用?C++ TIniFile::ReadInteger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TIniFile
的用法示例。
在下文中一共展示了TIniFile::ReadInteger方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TForm
//---------------------------------------------------------------------
__fastcall TFormMain::TFormMain(TComponent *Owner)
: TForm(Owner)
{
ProcIndex = -1;
HIDE = 0;
Caption = "Process Monitor";
TIniFile *Ini = new TIniFile( FILE_INI );
if ( Ini == NULL )
{
exit(1);
}
NMUDP1->LocalPort = Ini->ReadInteger( "CONF", "Port", 8081 );
for ( int i = 1; i < 20; i++ )
{
String str;
String section = "PROC";
section = section + i;
str = Ini->ReadString( section, "File", "" );
// remove as plicas "" e outros caracteres do caminho
str = str.Trim();
if ( str != "" )
{
Processos.push_back( str ); // caminho completo do executável
Args.push_back( Ini->ReadString(section, "Args", "") ); // argumentos de linha de comando
Modo.push_back( Ini->ReadInteger(section, "Mode", 0) ); // modo
WDCnt.push_back(0); // contagem inicial zerada
WDCntToRestart.push_back( Ini->ReadInteger(section, "RestartCount", 12) ); // tempo para restart
}
}
HIDE = Ini->ReadInteger( "CONF", "Hide", 0 );
}
示例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;
}
示例3: FormShow
//---------------------------------------------------------------------------
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;
}
}
}
示例4: FormShow
void __fastcall TMailSndForm::FormShow(TObject *Sender)
{
TIniFile *IniFile;
if (!FInitialized) {
FInitialized = TRUE;
IniFile = new TIniFile(FIniFileName);
HostEdit->Text = IniFile->ReadString(SectionData, KeyHost,
"localhost");
PortEdit->Text = IniFile->ReadString(SectionData, KeyPort,
"smtp");
FromEdit->Text = IniFile->ReadString(SectionData, KeyFrom,
"first->[email protected]>com");
ToEdit->Text = IniFile->ReadString(SectionData, KeyTo,
"john->[email protected];[email protected]>fr");
SubjectEdit->Text = IniFile->ReadString(SectionData, KeySubject,
"This is the message subject");
SignOnEdit->Text = IniFile->ReadString(SectionData, KeySignOn,
"your name");
Top = IniFile->ReadInteger(SectionWindow, KeyTop, (Screen->Height - Height) / 2);
Left = IniFile->ReadInteger(SectionWindow, KeyLeft, (Screen->Width - Width) / 2);
Width = IniFile->ReadInteger(SectionWindow, KeyWidth, Width);
Height = IniFile->ReadInteger(SectionWindow, KeyHeight, Height);
delete IniFile;
}
}
示例5: 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;
}
示例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;
}
示例7: GetDefaultSettings
// retrieves the default user settings
void PREFERENCES::GetDefaultSettings()
{
TIniFile* storage = new TIniFile( ExtractFilePath( Application->ExeName ) + INIFILENAME_PREFERENCES );
try
{
UserLevel = storage->ReadInteger( "Various", "DefaultUserLevel", USERLEVEL_ADVANCED );
#define READ_SCRIPT( name ) \
if( !mCmdlineSpecified[ name ] ) \
Script[ name ] = storage->ReadString( "Scripts", #name, "" );
READ_SCRIPT( AfterModulesConnected );
READ_SCRIPT( OnExit );
READ_SCRIPT( OnSetConfig );
READ_SCRIPT( OnResume );
READ_SCRIPT( OnSuspend );
READ_SCRIPT( OnStart );
#define READ_BUTTON( number ) \
Buttons[ number ].Name = storage->ReadString( "Buttons", "Button" #number "Name", "" );\
Buttons[ number ].Cmd = storage->ReadString( "Buttons", "Button" #number "Cmd", "" );
READ_BUTTON( 1 );
READ_BUTTON( 2 );
READ_BUTTON( 3 );
READ_BUTTON( 4 );
}
catch(...) {}
delete storage;
}
示例8: RestoreKeyInterval
//---------------------------------------------------------------------------
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;
}
示例9: 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;
}
}
}
示例10: FormShow
//---------------------------------------------------------------------------
void __fastcall TMainForm::FormShow(TObject *Sender)
{
static BOOL FirstTime = TRUE;
TIniFile *IniFile;
if (FirstTime) {
FirstTime = FALSE;
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);
PortEdit->Text = IniFile->ReadString(SectionData, KeyPort, "600");
MessageEdit->Text = IniFile->ReadString(SectionData, KeyMessage, "");
delete IniFile;
}
}
示例11: FormShow
//---------------------------------------------------------------------------
void __fastcall TTcpSrvForm::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();
// Delay startup code until our UI is ready and visible
PostMessage(Handle, WM_APPSTARTUP, 0, 0);
}
}
示例12: FormShow
//---------------------------------------------------------------------------
void __fastcall TFtpServerForm::FormShow(TObject *Sender)
{
TIniFile *IniFile;
int Minim;
if (!FInitialized) {
FInitialized = TRUE;
Caption = "Starting " MainTitle;
Left = -Width;
IniFile = new TIniFile(FIniFileName);
FXTop = IniFile->ReadInteger(SectionWindow, KeyTop, Top);
FXLeft = IniFile->ReadInteger(SectionWindow, KeyLeft, Left);
FXWidth = IniFile->ReadInteger(SectionWindow, KeyWidth, Width);
FXHeight = IniFile->ReadInteger(SectionWindow, KeyHeight, Height);
Minim = IniFile->ReadInteger(SectionWindow, KeyMinim, 0);
IniFile->Free();
LoadConfig();
SaveConfig(); // Create the inifile keys if they don't exists
// Be sure to always have the window visible
// with a reasonable width and height
if (FXLeft < 0)
FXLeft = 0;
if (FXTop < 0)
FXTop = 0;
if (FXWidth < 310)
FXWidth = 310;
if (FXHeight <= 250)
FXHeight = 250;
if ((FXLeft + FXWidth) > Screen->Width)
FXLeft = Screen->Width - FXWidth;
if ((FXTop + FXHeight) > Screen->Height)
FXTop = Screen->Height - FXHeight;
StartMinimizedCheckBox->Checked = (Minim != 0);
// We use a custom message to initialize things once the form
// is visible
PostMessage(Handle, WM_APPSTARTUP, 0, 0);
}
}
示例13: FormShow
//---------------------------------------------------------------------------
void __fastcall TMainForm::FormShow(TObject *Sender){
// 读取本地的一些设置,或是上次的配置参数
TIniFile *ini = new TIniFile(GetCurrentDir() + "\\app.ini");
int userId = ini->ReadInteger("Center", "UserId", 0);
AnsiString st = ini->ReadString("Center", "ST", "");
DateTimePicker->Time = ini->ReadTime("Center", "ShutdownTime", StrToTime("23:45:00"));
//是否跳过登录界面
if (userId ==0 || st ==""){
LoginForm->ShowModal();
}else{
controller->centerId =userId;
controller->centerSt =st;
}
TimerTask->Enabled =true;
// 创建一个ActionList用于动态保存各个标签页的Action
actionList = new TActionList(MainForm);
// 读取本地的一些设置,或是上次的配置参数
MainForm->Width = ini->ReadInteger("FormSize", "Width", 1024);
MainForm->Height = ini->ReadInteger("FormSize", "Height", 768);
delete ini;
//
FrameMonitor =new TFrameMonitor(this); //用这个Frame,主要是用来加竖滚动条的,并且支持鼠标滑轮滚动
FrameMonitor->Parent =PanelMonitorGroup;
//文件打印内容明细
StringGridTxt->Cells[0][0] ="行数";
StringGridTxt->Cells[1][0] ="游戏ID";
StringGridTxt->Cells[2][0] ="玩法类型";
StringGridTxt->Cells[3][0] ="投注方式";
StringGridTxt->Cells[4][0] ="彩票号码";
StringGridTxt->Cells[5][0] ="倍";
StringGridTxt->Cells[6][0] ="金额分";
for (int i =0; i <StringGridTxt->RowCount; i++) StringGridTxt->Cells[0][i+1] =IntToStr(i +1);
//后台管理浏览器加载,防止Document设置Cookie时为空
WideString HomePage =LOGIN_URL;
WebBrowser->Navigate(HomePage.c_bstr());
//显示登录页并且最大化窗口
PageControl->ActivePageIndex =1;
//总控制器初始化
controller->Init();
//调整位置
FormResize(this);
ShowErrMessage();
}
示例14: FormShow
//---------------------------------------------------------------------------
void __fastcall TMainForm::FormShow(TObject *Sender)
{
static BOOL FirstTime = TRUE;
TIniFile *IniFile;
if (FirstTime) {
FirstTime = FALSE;
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);
PortEdit->Text = IniFile->ReadString(SectionData, KeyPort, "600");
ServerEdit->Text = IniFile->ReadString(SectionData, KeyServer, "0.0.0.0");
delete IniFile;
DataAvailableLabel->Caption = "";
InfoLabel->Caption = "Click on Start button";
StartButton->Enabled = TRUE;
StopButton->Enabled = FALSE;
}
}
示例15: FormShow
//---------------------------------------------------------------------------
void __fastcall TSocksTestForm::FormShow(TObject *Sender)
{
TIniFile *IniFile;
if (!FInitialized) {
FInitialized = TRUE;
DisplayMemo->Clear();
IniFile = new TIniFile(FIniFileName);
Width = IniFile->ReadInteger(SectionWindow, KeyWidth, Width);
Height = IniFile->ReadInteger(SectionWindow, KeyHeight, Height);
Top = IniFile->ReadInteger(SectionWindow, KeyTop,
(Screen->Height - Height) / 2);
Left = IniFile->ReadInteger(SectionWindow, KeyLeft,
(Screen->Width - Width) / 2);
TargetHostEdit->Text = IniFile->ReadString(SectionData, KeyTargetHost, "");
TargetPortEdit->Text = IniFile->ReadString(SectionData, KeyTargetPort, "");
SocksServerEdit->Text = IniFile->ReadString(SectionData, KeySocksServer, "");
SocksPortEdit->Text = IniFile->ReadString(SectionData, KeySocksPort, "1080");
SocksUsercodeEdit->Text = IniFile->ReadString(SectionData, KeySocksUsercode, "");
SocksPasswordEdit->Text = IniFile->ReadString(SectionData, KeySocksPassword, "");
SocksAuthCheckBox->Checked = IniFile->ReadInteger(SectionData, KeySocksAuth, 0);
Socks4RadioButton->Checked = IniFile->ReadInteger(SectionData, KeySocks4, 0);
Socks5RadioButton->Checked = IniFile->ReadInteger(SectionData, KeySocks5, 1);
delete IniFile;
}
}