I want to execute a function in given date just once and i'm done with the Task
.
What should i do?
static void Main(string[] args)
{
DateTime date = GetExecuteTime();
using (TaskService ts = new TaskService())
{
// Create a new task definition and assign properties
TaskDefinition td = ts.NewTask();
td.RegistrationInfo.Description = "run method";
TimeTrigger d = new TimeTrigger();
d.StartBoundary = date;
td.Triggers.Add(d);
//td.Actions.Add();
}
Console.ReadKey(true);
}