发布网友 发布时间:2022-04-23 22:50
共1个回答
热心网友 时间:2023-06-24 15:16
不需要循环 一次就可以全读出来
TCHAR szPathName[MAX_PATH];
GetMoleFileName(NULL, szPathName, MAX_PATH);
CString strPathName = szPathName;
int nPos;
nPos = strPathName.ReverseFind (_T('\\'));
strPathName = strPathName.Left(nPos);
strPathName += "\\test.ini";
CString s;
GetPrivateProfileString("name", "username",NULL, s.GetBuffer(100), 100, strPathName);
MessageBox(s);