而不是0回车0,我在下面的文本文件中得到00,有什么问题? 我甚至添加了flush命令,但在" 0" ??
之间仍然没有回车符CFile p_File;
CString pBuffer;
DWORD ptext = 0;
ClientFile.Format(_T("Textfile.txt"));
if (!p_file.GetStatus(ClientFile, status))
!p_file.Open(ClientFile, CFile::modeCreate | CFile::modeReadWrite);
else if (!p_file.Open(ClientFile, CFile::modeReadWrite))
MessageBox(NULL, (LPCWSTR) "Can't open file", (LPCWSTR) "file", MB_OK);
pbuffer.Format(_T("%1u\r\n"), ptext);
p_file.SeekToEnd();
p_file.Write(pbuffer, pbuffer.GetLength());
p_file.Flush();
p_file.SeekToEnd();
p_file.Write(pbuffer, pbuffer.GetLength());
p_file.Flush();
p_file.Close();