MFC 文件按行读写 CStdioFile

//写文件

CStdioFile file;
file.Open("test.txt",CFile::modeCreate|CFile::modeReadWrite);
file.WriteString("A ha, hello!");

 

//读取abc.txt
CStdioFile file;
file.Open("abc.txt",CFile::modeRead);
CStringArray data;
CString line;
while (file.ReadString(line))
{
data.Add(line);
}

posted @ 2014-04-17 15:38  酷熊  阅读(1627)  评论(0编辑  收藏  举报