一阵狂风 发表于 2017-6-2 11:07:36

VC读配置文件

char szBugCC={0};
        int nRet = GetPrivateProfileSection("Setting", szBugCC, sizeof(szBugCC), BugConfig.c_str());
        if (nRet > 0)
        {
                //过滤/0 /0 /00
                DWORD dwIndex = 0;
                char szTemp={0};
                while (dwIndex < nRet)
                {
                        strcpy(szTemp, szBugCC+dwIndex);
                        //szTemp "11=11@163.com"
                        CString strTemp(szTemp);
                        int nPos = strTemp.Find("=");
                        m_combo_bugcc.AddString(strTemp.Left(nPos));
                        dwIndex += strlen(szTemp);
                        dwIndex++;
                }
        }

配置文件格式:

11=11@163.cn
22=22@163.cn
ope=0.cn
页: [1]
查看完整版本: VC读配置文件