遍历INI文件下某个section(最简单的配置):
WritePrivateProfileStringA("test","ID","12341679","D:\\test1.ini");char szBuffer[1024] = {0};
DWORD nLength = GetPrivateProfileStringA( "test",NULL,(""),szBuffer,sizeof(szBuffer),("D:\\test1.ini") );
vector<CStringA>vec;
CStringA str;
char *pChar = szBuffer;
int nLen = strlen(pChar);
while (nLen)
{
str = pChar;
vec.push_back(str);
pChar += nLen + 1;
nLen = strlen(pChar);
}
int a = 0;
for (int i = 0;i<vec.size();i++)
{
CStringA s = vec[i];
WritePrivateProfileStringA("test",s,"9876543210","D:\\test1.ini");
}