用vc怎么读取配置文件(急) 我第一次用,请问各位哥哥姐姐怎么来读取配置文件,举个例子:或推荐 好书。文章。谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Registry FunctionsThe following functions are used with the registry: RegCloseKey RegConnectRegistry RegCreateKey RegCreateKeyEx RegDeleteKey RegDeleteValue RegEnumKey RegEnumKeyEx RegEnumValue RegFlushKey RegGetKeySecurity RegLoadKey RegNotifyChangeKeyValue RegOpenKey RegOpenKeyEx RegQueryInfoKey RegQueryMultipleValues RegQueryValue RegQueryValueEx RegReplaceKey RegRestoreKey RegSaveKey RegSetKeySecurity RegSetValue RegSetValueEx RegUnLoadKey Obsolete Functions GetPrivateProfileInt GetPrivateProfileSection GetPrivateProfileSectionNames GetPrivateProfileString GetPrivateProfileStruct GetProfileInt GetProfileSection GetProfileString WritePrivateProfileSection WritePrivateProfileString WritePrivateProfileStruct WriteProfileSection WriteProfileString --->to:syy64(太平洋) 这都是什么啊,今天我是第三天学vc,再简单的还有吗。谢谢 你在google里搜索一下别人的例子照着改吧,让你直接写估计也很难,才三天,我晕! GetPrivateProfileIntGetPrivateProfileSectionGetPrivateProfileSectionNamesGetPrivateProfileStringGetPrivateProfileStruct //----------------------读配置文件WritePrivateProfileSectionWritePrivateProfileStringWritePrivateProfileStructWriteProfileSectionWriteProfileString //-----------------------写配置文件具体用法看msdn http://blog.csdn.net/lixiaosan/archive/2004/10/28/156609.aspx int main(){ int m_nXPos=GetPrivateProfileInt("SECTION 1", //节名 "XPos", //项名 0, //没找到此项时的缺省返回值 "F:\\vc-piezhi\\xuexipeizhi\\test.ini"); //配置文件的准确路径 int m_nYPos=GetPrivateProfileInt("SECTION 1","YPos",0,"F:\\vc-piezhi\\xuexipeizhi\\test.ini"); char buf[256];int len=GetPrivateProfileString("SECTION 2", //节名 "Text", //项名 "No Text", //没找到此项时的返回值 buf, //目标缓冲区地址 256, //目标缓冲区长度 "F:\\vc-piezhi\\uexipeizhi\\test.ini"); //配置文件的准确路径printf("%d\n",m_nYPos);printf("%s\n",buf); return 0;}-------配置文件----------[SECTION 1]XPos=300YPos=200[SECTION 2]Text=Hello-----------------------为什么打印是No Text呢??不应是hello吗?而m_nYPos 返回200正确 IWebBrowser接口 用VC开发的程序要正常运行,都必须先安装VCRedist包吗??? 关于BCG库使用问题,高分回报!!! 有没有方法获得CHtmlView中被选择的文本?I still need your response if their is no way. 哪里有 iphlpapi.h 可以download? 关于listview的subclass 在VC中如何确定有无内存泄漏? VARIANT类型是怎么传参的? 求教!如果在MFC上进行时间文本输出 什么书学习windows Sockets编程比较好? 如何设置richedit某行的背景色?不胜感激~! 程序界面高手回答
The following functions are used with the registry:
RegCloseKey
RegConnectRegistry
RegCreateKey
RegCreateKeyEx
RegDeleteKey
RegDeleteValue
RegEnumKey
RegEnumKeyEx
RegEnumValue
RegFlushKey
RegGetKeySecurity
RegLoadKey
RegNotifyChangeKeyValue
RegOpenKey
RegOpenKeyEx
RegQueryInfoKey
RegQueryMultipleValues
RegQueryValue
RegQueryValueEx
RegReplaceKey
RegRestoreKey
RegSaveKey
RegSetKeySecurity
RegSetValue
RegSetValueEx
RegUnLoadKey
Obsolete Functions
GetPrivateProfileInt
GetPrivateProfileSection
GetPrivateProfileSectionNames
GetPrivateProfileString
GetPrivateProfileStruct
GetProfileInt
GetProfileSection
GetProfileString
WritePrivateProfileSection
WritePrivateProfileString
WritePrivateProfileStruct
WriteProfileSection
WriteProfileString
这都是什么啊,今天我是第三天学vc,再简单的还有吗。谢谢
GetPrivateProfileSection
GetPrivateProfileSectionNames
GetPrivateProfileString
GetPrivateProfileStruct
//----------------------读配置文件
WritePrivateProfileSection
WritePrivateProfileString
WritePrivateProfileStruct
WriteProfileSection
WriteProfileString
//-----------------------写配置文件
具体用法看msdn
{
int m_nXPos=GetPrivateProfileInt("SECTION 1", //节名
"XPos", //项名
0, //没找到此项时的缺省返回值
"F:\\vc-piezhi\\xuexipeizhi\\test.ini"); //配置文件的准确路径
int m_nYPos=GetPrivateProfileInt("SECTION 1","YPos",0,"F:\\vc-piezhi\\xuexipeizhi\\test.ini");
char buf[256];
int len=GetPrivateProfileString("SECTION 2", //节名
"Text", //项名
"No Text", //没找到此项时的返回值
buf, //目标缓冲区地址
256, //目标缓冲区长度
"F:\\vc-piezhi\\uexipeizhi\\test.ini"); //配置文件的准确路径printf("%d\n",m_nYPos);
printf("%s\n",buf);
return 0;
}
-------配置文件----------
[SECTION 1]
XPos=300
YPos=200[SECTION 2]
Text=Hello
-----------------------为什么打印是No Text呢??不应是hello吗?而m_nYPos 返回200正确