CStdioFile按行读取文件.
virtual LPTSTR ReadString( LPTSTR lpsz, UINT nMax ); virtual BOOL ReadString( CString& rString ); |
CStdioFile aFile;
CFileException ex;
if (!aFile.Open("config.txt", CFile::modeRead, &ex))
{
ex.ReportError();
return;
}
char buf[BUFSIZ+1];
while (aFile.ReadString(buf, BUFSIZ))
{
TRACE(buf);
}
aFile.Close();CStdioFile aFile;
CFileException ex;
if (!aFile.Open("config.txt", CFile::modeRead, &ex))
{
ex.ReportError();
return;
}
CString strTmp;
while (aFile.ReadString(strTmp))
{
TRACE(strTmp);
}
aFile.Close();
声明:该文观点仅代表作者本人,入门客AI创业平台信息发布平台仅提供信息存储空间服务,如有疑问请联系rumenke@qq.com。
- 上一篇:没有了
- 下一篇:没有了
