我想读在C的.init配置文件++具有内容。
[IP地址]
IPADDRESS = 169.254.115.22
[ScanConfiguration]
Scanfrequency = 2500
ScanResolution = 2500
由startAngle = 700000
StopAngle = 1100000
到现在为止,我已经使用这个代码读取数据。 我的项目是Unicode字符集和字串值之前,因此,使用升。
int iScanFreq =GetPrivateProfileInt(L"ScanConfiguration",L"Scanfrequency", 2500, L"filename.ini");
int iScanRes =GetPrivateProfileInt(L"ScanConfiguration",L"ScanResolution", 2500, L"filename.ini");
int iStartAngle =GetPrivateProfileInt(L"ScanConfiguration",L"StartAngle", -450000, L"filename.ini");
int iStopAngle =GetPrivateProfileInt(L"ScanConfiguration",L"StopAngle", 2250000, L"filename.ini");
但我只得到了从文件中的变量值不正确的默认值。 我还没有对注册表的任何迹象。 有什么我在注册表中得到正确的价值做..
任何建议将是有益的感谢。