Get last run date of task in Windows Scheduled Tasks from ASP.NET

不问归期 提交于 2020-01-13 05:11:06

问题


Is it possible to get the last run date of a scheduled task in Windows Scheduled Tasks from ASP.NET?

Ideally, it would be good to be able to list, start and stop these tasks as well, though at this stage, the main thing I'd like to do is retrieve the last run time for a specific scheduled task.

If this is not possible, my workaround is to simply have the application being run update the database or XML file with it's last run date, but as this information is already stored in Scheduled Tasks, I was wondering if it might just be easier to read the data straight from there.


回答1:


Use the Task Scheduler Managed Wrapper 1.2 ( Free Download ) and then use the Task.LastRunTime Property



来源:https://stackoverflow.com/questions/565922/get-last-run-date-of-task-in-windows-scheduled-tasks-from-asp-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!