从 ASP.NET 获取 Windows 计划任务中任务的上次运行日期 [英] Get last run date of task in Windows Scheduled Tasks from ASP.NET

查看:61
本文介绍了从 ASP.NET 获取 Windows 计划任务中任务的上次运行日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从 ASP.NET 获取 Windows 计划任务中计划任务的最后运行日期?

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.

如果这是不可能的,我的解决方法是让正在运行的应用程序更新数据库或 XML 文件的上次运行日期,但由于此信息已存储在计划任务中,我想知道它是否可能只是更容易直接从那里读取数据.

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.

推荐答案

使用 Task Scheduler Managed Wrapper 1.2(免费下载)然后使用 Task.LastRunTime 属性

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

这篇关于从 ASP.NET 获取 Windows 计划任务中任务的上次运行日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆