CFile写入文件换行的问题!!急!!
我用如下代码:
void CReadfDlg::OnButton6()
{
// TODO: Add your control notification handler code here
CString time_str;
CString line="\r\n";
CTime t;
t=CTime::GetCurrentTime();
CFile file;
file.Open("rtdata.txt",CFile::modeCreate|CFile::modeWrite);
time_str.Format("00000,%d-%d-%d %d:%d:%d,0007,1,0,0,",t.GetYear(),t.GetMonth(),t.GetDay(),t.GetHour(),t.GetMinute(),t.GetSecond());
file.Write(time_str,strlen(time_str));
file.SeekToEnd();
file.Write(line,line.GetLength());
file.Close();
}
怎么执行几次后还是只有一行数据??