关于保存图片或者说文件以系统时间命名

//获取系统时间 

CTime currTime;
currTime = CTime::GetCurrentTime();
CString strTime;
strTime.Format(_T("%.4d-%.2d-%.2d-%.2d-%.2d-%.2d"), currTime.GetYear(), currTime.GetMonth(), currTime.GetDay(), currTime.GetHour(), currTime.GetMinute(), currTime.GetSecond());

//获取路径

CString strPath;
strPath = _T("D:\\MFCPicture\\") + strTime +_T(".bmp");
//然后把路径添加上去就可以了

猜你喜欢

转载自blog.csdn.net/qq_39480894/article/details/82183898