CString getPath(){ CTime time = CTime::GetCurrentTime(); CString t = time.Format(_T("%Y%m%d%H%M%S")); CString path("c://cjt//"); path.Append(_T("device")); path.Append(t); path.Append(_T(".txt")); } int main(){ CString path = getPath(); if(!PathFileExists(_T("c://cjt"))){ _mkdir("c://cjt"); } }