Run a specific task in Task Scheduler using ASP.NET C# -
i have button in asp.net web application. want button invoke task in task scheduler. didn't find exact code invoke task task scheduler. please help....!!!
have @ documentation library. wrapper windows task scheduler.
http://taskscheduler.codeplex.com
which wrapper task scheduler windows api https://msdn.microsoft.com/en-us/library/windows/desktop/aa383614(v=vs.85).aspx
using wrapper can interact task scheduler code this
using (taskservice ts = new taskservice()) { task t = ts.gettask(taskname); if (t != null) { // status here or runtime var isenabled = t.enabled; var runs = t.getruntimes(startdate,enddate); } }
now should remember can not poll status of task while holding asp.net request processing cycle. best can checking status in ajax calls until task finished.
meanwhile re-evaluate design , suitability of task scheduler purpose. securing website while allowing access task scheduler might challenge. 1 other option windows service develop , runs requested tasks web application. has worked me. client can asp.net ajax or javascript getting status of task through web api
Comments
Post a Comment