Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/157.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
具有windows任务计划程序的控制台应用程序每5分钟的定期计划 我在这里找到了C++代码示例:创建任务触发器 _C++_Windows_Scheduled Tasks - Fatal编程技术网

具有windows任务计划程序的控制台应用程序每5分钟的定期计划 我在这里找到了C++代码示例:创建任务触发器

具有windows任务计划程序的控制台应用程序每5分钟的定期计划 我在这里找到了C++代码示例:创建任务触发器 ,c++,windows,scheduled-tasks,C++,Windows,Scheduled Tasks,我们有: pTrigger.wBeginDay =1; // Required pTrigger.wBeginMonth =1; // Required pTrigger.wBeginYear =1999; // Required pTrigger.cbTriggerSize = sizeof (TASK_TRIGGER); pTrigger.wStartHour = 13; pTrigger.Trigg

我们有:

pTrigger.wBeginDay =1;                  // Required
pTrigger.wBeginMonth =1;                // Required
pTrigger.wBeginYear =1999;              // Required
pTrigger.cbTriggerSize = sizeof (TASK_TRIGGER); 
pTrigger.wStartHour = 13;
pTrigger.TriggerType = TASK_TIME_TRIGGER_DAILY;
pTrigger.Type.Daily.DaysInterval = 1;
TriggerType是任务\触发器\类型

typedef enum _TASK_TRIGGER_TYPE { 
TASK_TIME_TRIGGER_ONCE             = 0,
TASK_TIME_TRIGGER_DAILY            = 1,
TASK_TIME_TRIGGER_WEEKLY           = 2,
TASK_TIME_TRIGGER_MONTHLYDATE      = 3,
TASK_TIME_TRIGGER_MONTHLYDOW       = 4,
TASK_EVENT_TRIGGER_ON_IDLE         = 5,
TASK_EVENT_TRIGGER_AT_SYSTEMSTART  = 6,
TASK_EVENT_TRIGGER_AT_LOGON        = 7
} TASK_TRIGGER_TYPE, *PTASK_TRIGGER_TYPE;
但我想每5分钟触发一次控制台应用程序。
建议?

启动您的程序一次,并使用事件暂停程序,然后每5分钟重新启动一次。任务调度器可以用于(滥用)您想要做的事情,但它不是最好的方法。请看,我不想暂停我的程序,它需要定期终止,但我需要每5分钟调用一次。我不明白在TASK_TRIGGER_类型中如何设置每日触发器(例如,每2小时或每5分钟一次)。谢谢你的回复