DWORD GetPrivateProfileSection(
LPCTSTR lpAppName, // address of section name
LPTSTR lpReturnedString, // address of return buffer
DWORD nSize, // size of return buffer
LPCTSTR lpFileName // address of initialization filename
);
你可以这样:DWORD len;
char buff[4096];
len = GetPrivateProfileSection("section",buff,sizeof(bufff),lpFileName);
if(len > 0)//成功,所有的 keyname 都在 buff 里面了
;
LPCTSTR lpAppName, // address of section name
LPTSTR lpReturnedString, // address of return buffer
DWORD nSize, // size of return buffer
LPCTSTR lpFileName // address of initialization filename
);
你可以这样:DWORD len;
char buff[4096];
len = GetPrivateProfileSection("section",buff,sizeof(bufff),lpFileName);
if(len > 0)//成功,所有的 keyname 都在 buff 里面了
;
而且,buff中是不是按照key value得模式存储的,如此查找key是不是很麻烦,有没有简单点的方法呢就是说,我获得了返回的buff指针,其中有我需要的key 和 我并不想要的value,而且key 和value是一一对应关系的,在buff中顺序排列存储的。我打算根据某个我已经知道的value来查找buff字符串,希望获得value 对应的key值,这到底因该怎么做呢?
哪位高手有代码呀?先谢过了~~~~~
问题已经得到解决,谢谢PatrickGamp的提示
过来受分吧~~~~~~~~