Task Scheduler in C# for the specific day

ساخت وبلاگ
چکیده : By using below code snippet, I can schedule my task but the problem is task is getting scheduled for... با عنوان : Task Scheduler in C# for the specific day بخوانید :

By using below code snippet, I can schedule my task but the problem is task is getting scheduled for all days from the starting day i.e. DailyTrigger. I wanted it to schedule the task for the specific day not daily and dont wanted it to be ran automatically for next day again. How can I achive this? using Microsoft.Win32.TaskScheduler; // this is the 2.0 library namespace TaskSchedulerForDataUsage { class Program { static void Main(string[] args) { using (TaskService myTaskService=new TaskService()) { TaskDefinition myTaskDefinition = myTaskService.NewTask(); myTaskDefinition.RegistrationInfo.Description = "Does Something"; myTaskDefinition.Triggers.Add(new MonthlyTrigger(1,MonthsOfTheYear.AllMonths)); myTaskDefinition.Actions.Add(new ExecAction("Here is a path with a .exe ",null,null)); myTaskService.RootFolder.RegisterTaskDefinition(@"AwesomeStuff",myTaskDefinition); //in case you want to erase the task //myTaskService.RootFolder.DeleteTask("AwesomeStuff"); } } }

back soft...
ما را در سایت back soft دنبال می کنید

نویسنده : استخدام کار بازدید : 7 تاريخ : جمعه 7 دی 1397 ساعت: 17:02