MFC 以当前的时间作为文件名保存文件

来源:互联网 发布:手机淘宝信用等级 编辑:程序博客网 时间:2024/05/22 12:34
CTime tm = CTime::GetCurrentTime();CString str2;str2.Format(_T("D:\\%d_%d_%d__%d_%d_%d.txt"),tm.GetYear(),tm.GetMonth(),tm.GetDay(),tm.GetHour(),tm.GetMinute(),tm.GetSecond());AfxMessageBox(str2);CFile file;file.Open(str2,CFile::modeCreate |CFile::modeNoTruncate |CFile::modeWrite);

原创粉丝点击