当前位置:编程学习 > C/C++ >>

向INI配置文件写入\读取数据

//ini配置文件路径
#define GOODSCATEGORYENGINE_FILE _T("C:\\ClientDirEda")
#define GOODSCATEGORYENGINE_INI _T("C:\\ClientDirEda\\StartX.ini")

#define GOODSCATEGORYENGINE_INI_TEST _T("C:\\ClientDirEda\\GoodsCategoryEngine.ini")

 


CString str = _T("我成功读取到ini配置文件了!"),StartXStr;
int fileSize1,fileSize2;
//读取ini文件
 fileSize1 = GetPrivateProfileString(_T("StartX"),_T("Title"),
                    NULL,StartXStr.GetBuffer(MAX_PATH),MAX_PATH,GOODSCATEGORYENGINE_INI);
//向ini文件写入数据
fileSize2 = WritePrivateProfileString(_T("aaa"),_T("bbb"),
                    str,GOODSCATEGORYENGINE_INI_TEST);


 

补充:软件开发 , C++ ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,