如何从config .ini文件中获取数据 [英] How to get data from config .ini file

查看:94
本文介绍了如何从config .ini文件中获取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过从borland C ++的INI文件中获取信息,但我无法获得正确的信息



config .ini

[站点}

北= 1

南= 2



我尝试过:



TIniFiloe * str = new TIniFile(config.ini)

int k = str-> ReadInteger( 站点,北方,0);

这里k值我得到alwyas 0 tahts什么从imIn过来的ReadInteger第三个参数。

我们必须通过第三个参数?



我正在使用Borland编译器

解决方案

我会打电话给

 str-> ReadInteger(  SITE   North  0 


HI i have tried get the information from INI file in borland C++ but im not able get the correct info

config .ini
[SITE}
North=1
South =2

What I have tried:

TIniFiloe *str=new TIniFile("config.ini")
int k = str->ReadInteger("SITE","NORTH",0);
here k value im getting alwyas 0 tahts what ever im passing from ReadInteger 3rd argument.
what we have to pass the third argument?

im using Borland compiler

解决方案

I would call

str->ReadInteger("SITE","North",0)


这篇关于如何从config .ini文件中获取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆