什么相当于 ASP.NET 中的 cron 作业? [英] What is the equivalent to cron jobs in ASP.NET?

查看:19
本文介绍了什么相当于 ASP.NET 中的 cron 作业?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 PHP 中,我们有 cron 作业,其中托管服务器根据给定的时间表自动选择并执行任务.

In PHP we have cron jobs, where the hosting server automatically picks up and executes a task as per the schedule given.

在 ASP.NET 中使用 CRON 作业有什么好的替代方法?我想使用 Web 服务,但这在共享托管环境中不起作用.任何帮助将不胜感激,并请提供一种在共享托管环境中专门执行此操作的方法.

What would be a good alternative to use for CRON jobs in ASP.NET? I'd like to use a Web service, but that will not work in a shared hosting environment. Any help would be appreciated, and please advise a way to do this specifically in a shared hosting environment.

推荐答案

尝试 Quartz.NET.这是一个不错的 .NET 调度程序,支持 CRON 表达式CRON 触发器 以及各种其他手段和方法来安排在特定时间/间隔执行的任务.

Try Quartz.NET. It's a decent .NET scheduler which supports CRON expressions, CRON triggers and various other means and methods to schedule tasks to be performed at certain times / intervals.

它甚至包括一个基本的 Quartz.NET 服务器(Windows 应用程序),可能满足您的需求.

It even includes a basic Quartz.NET server (Windows Application) that might fit your needs.

如果您无法在共享主机中运行应用程序或 Windows 服务,那么可能类似于ASP.NET 中的简单后台任务"你会吗?它使用 HttpRuntime.Cache 模拟 Windows 服务,并且不需要任何外部依赖.

If you can't run applications or windows services within your shared hosting then perhaps something like "Easy Background Tasks in ASP.NET" will do you? It simulates a Windows Service using HttpRuntime.Cache and removes the need for any external dependancies.

这篇关于什么相当于 ASP.NET 中的 cron 作业?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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