MFC如何获取CFG配置文件里面的字符串 我要获取test和1这俩行的字符串然后保存到数组里面 怎么操作??? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可以用基本的C函数 fopen fgets fclose#include <stdio.h>void main( void ){ FILE *stream; char line[100]; if( (stream = fopen( "fgets.c", "r" )) != NULL ) { if( fgets( line, 100, stream ) == NULL) printf( "fgets error\n" ); else printf( "%s", line); fclose( stream ); }} CStdioFile txtIn; if(!txtIn.Open(TransFile,CFile::modeRead | CFile::typeText | CFile::shareDenyNone)) { AfxMessageBox("无法打开文件!"); return; } CString OneLine; while(txtIn.ReadString(OneLine)) { OneLine.Empty(); } txtIn.Close(); vc调用并关闭word时,提示“此文件正由另一个应用程序或用户使用” normal.dot MFC中工具栏上的字怎么弄下划线? 关于DLL共享变量 CMetalFileDc 在MainFrm类中添加View类类型的成员变量出现的问题 如何在DLL中导出一个字符串的变量呢? 如何显示一个动态生成的ActiveX控件的ToolTip? 请教用什么函数可以从硬盘取.bmp格式的图象进行显示 b/s问题 关于picture控件上图标拉长的问题 Windows10 系统下vs2015开发64位程序CopyMemory的参数指针是多少位的? CreateFile可以创建目录吗?
{
FILE *stream;
char line[100]; if( (stream = fopen( "fgets.c", "r" )) != NULL )
{
if( fgets( line, 100, stream ) == NULL)
printf( "fgets error\n" );
else
printf( "%s", line);
fclose( stream );
}
}
if(!txtIn.Open(TransFile,CFile::modeRead |
CFile::typeText | CFile::shareDenyNone))
{
AfxMessageBox("无法打开文件!");
return;
}
CString OneLine;
while(txtIn.ReadString(OneLine))
{
OneLine.Empty();
}
txtIn.Close();