问题
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