CStdioFile file;file.open("a.txt");CString str;while(file.isEof){ file.readLine(str);}
CString data=_T("我会写TXT啦!");CFile txttest("D:test.txt",CFile::modeCreate|CFile::modeWrite);txttest.Write(data,data.GetLength()); txttest.Close();