void ReadFile(CString filePath)
{
CStdioFile readFile;
CString readLine; // 读到的每一行
BOOL flag = readFile.Open(filePath, CFile::modeRead);
if (flag == FALSE)
{
MessageBox(_T("打开文件失败"));
return;
}
else
{
while (readFile.ReadString(readLine))
{
TRACE("%s\n", readLine);
}
}
return;
}
网友评论