我的图片是依照时间形式命名。(月 天 日 时 分 秒)设置了两个data time picker控件,然后设置这个控件的时间,把时间范围内所有的图片全部删除,而且我看网上说datatimepicker控件的format有custom,我的vs不知道为啥没有
2条回答 默认 最新
- 赵4老师 2022-08-26 11:37关注
仅供参考:
#include <afxdisp.h> #include <stdio.h> #include <stdlib.h> int main(int argc, TCHAR* argv[]) { COleDateTime t; COleDateTimeSpan ts; CString s,fmt; int nYear; int nMonth; int nDay; int nHour; int nMin; int nSec; int lDays; int nHours; int nMins; int nSecs; int i,N; // initialize MFC and print and error on failure if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0)) { printf("Fatal Error: MFC initialization failed\n"); return 1; } if (argc<13) { printf("Usage:%s sYYYY sMM sDD shh smm sss pDD phh pmm pss n {SQL|YYYY|YY}\n",argv[0]); return 2; } if (stricmp(argv[12],"SQL")==0) fmt="%Y-%m-%d %H:%M:%S"; else if (stricmp(argv[12],"YYYY")==0) fmt="%Y%m%d %H%M%S"; else if (stricmp(argv[12],"YY")==0) fmt="%y%m%d %H%M%S"; else { printf("Usage:%s sYYYY sMM sDD shh smm sss pDD phh pmm pss n {SQL|YYYY|YY}\n",argv[0]); return 3; } nYear =atoi(argv[ 1]); nMonth=atoi(argv[ 2]); nDay =atoi(argv[ 3]); nHour =atoi(argv[ 4]); nMin =atoi(argv[ 5]); nSec =atoi(argv[ 6]); lDays =atoi(argv[ 7]); nHours=atoi(argv[ 8]); nMins =atoi(argv[ 9]); nSecs =atoi(argv[10]); N =atoi(argv[11]); if (N<=0) { printf("Usage:%s sYYYY sMM sDD shh smm sss pDD phh pmm pss n {SQL|YYYY|YY}\n",argv[0]); return 4; } t=COleDateTime( nYear, nMonth, nDay, nHour, nMin, nSec); ts=COleDateTimeSpan( lDays, nHours, nMins, nSecs ); for (i=1;i<=N;i++) { s=t.Format(fmt); printf("%08d %s\n",i,s); t=t+ts; } return 0; }
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
- ¥100 为什么这个恒流源电路不能恒流?
- ¥15 有偿求跨组件数据流路径图
- ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
- ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
- ¥15 CSAPPattacklab
- ¥15 一直显示正在等待HID—ISP
- ¥15 Python turtle 画图
- ¥15 stm32开发clion时遇到的编译问题
- ¥15 lna设计 源简并电感型共源放大器