用CStdioFile类打开文件,然后用ReadString来读取就可以。
肯定能实现。
肯定能实现。
解决方案 »
- 如何把灰度位图转换成矢量图?先谢了!
- 如何让ctrl+s 执行我编写的代码
- VC 中隐藏自已的进程如何实现?
- 关于自动评分系统的实现方法
- 求助:我需要在DLL中声明一些外部变量,在DLL中不定义,但编译怎么老是说连接不上啊?万分感谢!
- 请教关于读取 Internet Temporary Files 目录里的图片
- 如何调试自定义的Gina。dll,它把我的机器都弄得蓝屏了
- 如何利用ipicture render在指定图像框内显示相同大小的jpg图片
- updatewindow()到底怎么用?
- 最好的双语或多语种成品软件的编制方法是什么?
- Writing Windows WDM Device Driver 的例子
- 统计:你最崇拜的程序员是谁?
try
{
CStdioFile file("c:\\autoexec.bat",CFile::modeRead);
while(file.ReadString(csLine))
AfxMessageBox(csLine);
}
catch(...)
{
AfxMessageBox("打开文件错");
}
char* pszPath = NULL;
::GetMacroBasePath(&pszPath);
ifstream file;
file.open(pszPath,ios::nocreate|ios::in);
if(pszPath) delete pszPath;
if(!file.good()) return rtnValue; char buffer[256];
file.getline(buffer,255);
if(_stricmp(buffer,"VERSION = 1.0") != 0)
return rtnValue; CString strTemp(_T(""));
file.getline(buffer,255);
while(_stricmp(buffer,"") != 0)
{
strTemp = CString(buffer);
file.getline(buffer,255);
}
CFileException e;
char *FileName = "temp.txt";
if( !f.Open( FileName, CFile::modeRead, &e ) )
{ return;}
CString line;
while (f.ReadString(line))
{
}
f.Close();
readtring
;)
111222说得很清楚