每十分钟执行一段代码 [英] execute a piece of code every ten minutes

查看:91
本文介绍了每十分钟执行一段代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想每十分钟执行一次代码.如何在ASP.NET中做到这一点?该代码将向大约100个人发送一封电子邮件.我不需要电子邮件方面的帮助,只需要管理时间的部分即可.举例来说,如果有帮助,可以说我有500个人可以向其发送消息.我需要将消息发送到前100个,等待10分钟,然后将其发送到101-200,等待10分钟,依此类推,直到将其发送给所有500个.

I want to execute a piece of code every ten minutes or so. How can I do that in ASP.NET ? The code will send an E-mail to roughly 100 people. I don''t need assistance on the E-mailing, just the piece that manages the timing. If it helps, as an example, let''s say I have 500 people to send a message to. I need to send the message to the first 100, wait 10 minutes, then send it to 101-200, wait ten minutes, and so on until I have sent it to all 500. I need to be able to set this code to start at a particular time as well.

推荐答案

我为此需要Windows服务.
I Need Windows Service for that.


您需要一个简单的计划任务,即windows服务或SQL Server作业. ASP.NET并不是真正适合该任务的工具.
You want a simple scheduled task, windows service, or SQL Server job for this. ASP.NET is not really the appropriate tool for the task.


这篇关于每十分钟执行一段代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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