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