I have a .NET application running, and I want it to run a task that I already scheduled with the Windows Task Scheduler. The Task is written as its own console application.
I tried listing the arguments in the function: Run(arg1, arg2), but upon reading the documentation I learned this is not correct.
The Task would be deleting certain types of records (defined as an enum)
ASP.NET App:
using (var ts = new TaskService())
{
var deleteRecords = ts.FindTask("DeleteRecords");
deleteRecords.Run(); //Want to Pass Args into this task
}
Task
namespace DeleteRecords {
class Program {
static void Main(string[] args) {
string recordName = args[0];
string recordType = args[1];
//Then get and Delete Delete Record
}
}
}
Right now when I the ASP.NET application, it spawns the task, but exits with an out of index error, which makes sense since the args are not defined.