在当前路径创建一个报告文件

来源:互联网 发布:php遍历json对象 编辑:程序博客网 时间:2024/04/28 14:51
void CABCToolDlg::CreateReportFile(CHAR cDiskLable)
{
 CTime time = CTime::GetCurrentTime();
 m_csReportFileName = GetCurrPath();
 m_csReportFileName += "\\ABCTestReport\\";
 if (!::PathFileExists(m_csReportFileName))
 {
  CreateDirectory(m_csReportFileName, NULL);
 }
 m_csReportFileName += cDiskLable;
 m_csReportFileName += time.Format("%y%m%d%H%M%S");
 m_csReportFileName += ".txt";
 CStdioFile file;
 if (file.Open(m_csReportFileName, CFile::modeCreate))
 {
  file.Close();
 }
}
原创粉丝点击