[VC++]配置文件读取

[VC++]配置文件读取

2012-2-17 11:04| 发布者: benben| 查看: 557| 评论: 0

摘要: 1.读取VALUE为字符串DWORD dwRet = 0;GetCurrentDirectory(MAX_PATH,currentPath); wsprintf(currentPath,_T("%s%s"),currentPath,iniFile); dwRet = GetPrivateProfileString(_T("SECTION"),_T({%" ...

1.读取VALUE为字符串

DWORD dwRet = 0;

GetCurrentDirectory(MAX_PATH,currentPath);
wsprintf(currentPath,_T("%s%s"),currentPath,iniFile);
dwRet = GetPrivateProfileString(_T("SECTION"),_T("KEY"),NULL,strIP,LenIPBuffer,currentPath);
if (0 == dwRet)
{
    return READ_INI_FAILED;
}

2.读取VALUE为整形

VALUE = http://www.cnblogs.com/sanquanfeng/archive/2012/01/12/GetPrivateProfileInt(_T("SECTION"),_T("KEY"),NULL,currentPath);
if (0 == VALUE )
{
    return READ_INI_FAILED;
}

Always go with the choice that scares you the most, because that's the one that is going to require the most from you!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值