如何查看更改日期。 [英] How to check change in date.

查看:84
本文介绍了如何查看更改日期。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在每天的凌晨12:00发送自动生成的电子邮件。我如何编写一个程序来检查时间事件每天12:00 AM



我尝试过:



我想在每天凌晨12点发送自动生成的电子邮件。我如何编写一个程序,每天检查时间事件12:00 AM

I want to send auto generated email at time 12:00 AM each day. how I code a program that check time event 12:00 AM at each day

What I have tried:

I want to send auto generated email at time 12:00 AM each day. how I code a program that check time event 12:00 AM at each day

推荐答案

你可以设置一个计时器,或者一个监视当前日期和时间的BackgroundWorker几分钟和触发器发送电子邮件 - 这并不困难。但是......效率非常低,因为它会坐在那里一直在等待它每天一次大的机会。



更好解决方案是设置Windows以在特定时间运行您的应用程序:安排一个任务 - Windows帮助 [ ^ ] - 你的应用程序打开,检查它是否今天发送了一个,如果不是这样,那么任何一种方式都会关闭。甚至不需要用户界面!
You could setup a timer, or a BackgroundWorker that monitors the current date and time every couple of minutes and triggers to send the email - that wouldn't be difficult. But...it would be very inefficient as it would be "sitting there" running all the time waiting for it's "one big chance" every day.

A better solution would be to set up Windows to run your app at a specific time: Scheduling a task - Windows Help[^] - your app opens, checks if it's sent one today, if not it does so, then either way closes down. Doesn't even need a user interface!


这篇关于如何查看更改日期。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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