在Vb.net中使用计时器控制如何检查日期是否更改..... [英] Using Timer Control in Vb.net How To Check Date Is change.....

查看:115
本文介绍了在Vb.net中使用计时器控制如何检查日期是否更改.....的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Vb.net中创建了一个祝生应用程序,问题是我通过查询使用计时器获取数据,但计时器每秒都与数据库通信并获取数据。我尝试与数据库进行一次通信只有一次时间24小时当日期发生变化时其他没有通过vb.net中的计时器与数据库进行通信

i make A Birth Day Wishing Application in Vb.net and Problem is i using timer get data through a query but timer is communicate to database every second and Get Data. and i tried to communicate with database only one time afire 24 Hours when date is change else not communicate to database using timer in vb.net

推荐答案

设置计时器运行每24小时一次。

将最后一次运行日期存储在数据库中,甚至存储在本地内存中。



当计时器运行时,上次运行日期小于当前日期,执行查询代码。
Set the timer to run once every 24 hours.
Store the last run date in a database or even in local memory.

When the timer runs, when the last run date is less than the current date, execute your query code.


这篇关于在Vb.net中使用计时器控制如何检查日期是否更改.....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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