CFile mFile;
mFile.Open ("Play.txt",CFile::modeCreate|CFile::modeNoTruncate|CFile::modeWrite);
CArchive ar(&mFile,CArchive::store);
CString strTem=m_string;//m_string 为一个编辑框的变量
ar<<strTem;
ar.Close();
mFile.Close(); 用上述代码就可以把编辑框的内容写道Play.txt中,可是如果我再写一次的话,就会把原来的数据覆盖,不知道有什么方法可以避免,让他写完一条然后再写下一条?
mFile.Open ("Play.txt",CFile::modeCreate|CFile::modeNoTruncate|CFile::modeWrite);
CArchive ar(&mFile,CArchive::store);
CString strTem=m_string;//m_string 为一个编辑框的变量
ar<<strTem;
ar.Close();
mFile.Close(); 用上述代码就可以把编辑框的内容写道Play.txt中,可是如果我再写一次的话,就会把原来的数据覆盖,不知道有什么方法可以避免,让他写完一条然后再写下一条?
mFile.WriteString(m_string);
mFile.Close();这个行不行?
SeekToEnd!