本文介绍了从控制台应用程序发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经创建了一个用于发送电子邮件的控制台应用程序,发送时间存储在数据库中. 当当前时间与存储的时间匹配时,如何对控制台应用程序进行编程以使其运行? 请给我一些好的解决方案. 在此先感谢
I have created a console application for sending email, The sending time is stored in database. How to program the console application to run when the current time matches the stored time? Please give me some good solutions. Thanks in advance
推荐答案您可以使用 System.Threading.Timer 创建计时器,该计时器将在特定的时间间隔内执行您的功能.此关联的功能将检查与数据库时间与当前时间匹配的所有重新记录. 没有计时器的另一种方法是,您可以创建一个任务调度程序,该任务将执行定义的时间间隔并从数据库中获取所有记录.您可以通过任务计划程序执行任何点网应用程序. 希望其中一种解决方案对您有用. Hi, You can use System.Threading.Timer to create Timer that will execute your function with particular time interval. This associated function will check all the recoreds that match the database time with current time. Another way without timer is, you can create one task scheduler that will execute defined time interval and fetch all the records from the database. you can execute any of the dot net application through task scheduler. Hope one of the solution may work for you.
更多推荐
从控制台应用程序发送电子邮件
发布评论