如何自动运行网页 [英] How to run a webpage automatically

查看:106
本文介绍了如何自动运行网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网页,如果我运行该页面,它将发送一封邮件。



可以每天晚上8点发送电子邮件。

I have a webpage if i run the page it will sent one mail.

is it possible to sent an email every day 8pm.

推荐答案

为什么你需要网页这样的任务?我会创建简单的控制台应用程序来发送电子邮件然后通过使用Windows计划任务我将在每天晚上8点运行控制台应用程序exe文件。

如果你只需要使用ASP.NET读取< a href =http://blog.stackoverflow.com/2008/07/easy-background-tasks-in-aspnet/> Jeff Atwood的这项技术 [ ^ ]并检查http://www.quartz-scheduler.net/ [ ^ ]用于安排任务的库。
Why you need web page for such task? I would create simple console application to send email and then by using windows scheduled task I will run the console application exe file on every day 8pm.
if you need to do this only using ASP.NET read This technique by Jeff Atwood[^] for Stackoverflow and also check http://www.quartz-scheduler.net/[^] library for scheduling tasks.


你也可以通过创建sql job来完成它并按时计划你的工作每天8 :00 AM
you can do it by creating sql job also and schedule your job for every day with time 8:00 AM


没有代码可以自动运行 。您需要创建一个触发器来调用/执行发送电子邮件的方法。



你可以为此创建一个JavaScript间隔,如果时间是早上8点,则触发发送电子邮件的功能。否则,您不能指望代码自动运行。即使愿意,也会永远运行,如果时间是早上8点,我们会发送电子邮件。
No code can run automatically. You need to create a trigger which would invoke/execute the method to send the email.

You can either create a JavaScript interval for this, to trigger the function to send the email if the time is 8AM. Otherwise, you cannot expect the code to run automatically. Even if would, it would run forever and would send an email if the time is 8AM.


这篇关于如何自动运行网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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