char* pszFileName="F:\\myfile.txt";
CStdioFile myFile;
CFileException fileException;
if(myFile.Open(pszFileName,CFile::typeText|CFile::modeCreate|CFile::modeReadWrite|CFile::modeNoTruncate),&fileException)
{
myFile.SeekToEnd();
myFile.WriteString(stime);
myFile.WriteString("\n");
myFile.SeekToEnd();
myFile.WriteString(str1);
myFile.WriteString("\n");
myFile.SeekToEnd();
myFile.WriteString(str2);
myFile.WriteString("\n");
myFile.SeekToEnd();
myFile.WriteString(str3);
myFile.WriteString("\n");
myFile.Close();
MessageBox("文件写入成功","提示");
}
else
{
TRACE("Can't open file %s,error=%u\n",pszFileName,fileException.m_cause);
}
C++怎么写就怎么写啊。。。