Append text to a file
See below procedure:
- open file,
CStdioFile::Open
|
- Set the file pointer to the end of the file.
CFile::SeekToEnd
|
- write a text
CStdioFile::WriteString
|
For example:
CStdioFile file;
if(file.Open(L"C:\\Set.cmd", CFile::modeNoTruncate|CFile::modeWrite))
file.SeekToEnd();
file.WriteString(_T("Hello"));
else{
//show failed
}
|
留言
張貼留言