[英]How to fire an event in asp.net when today changes to next day?
How to fire an event (in asp.net with c#) when today changes to next day.当今天更改为第二天时,如何触发事件(在 asp.net 中使用 c#)。
You can use a Timer object.您可以使用定时器 object。 Set the Timer to check every second, minute, or hour (as you see fit).将计时器设置为每隔一秒、一分钟或一小时检查一次(如您所见)。 When the date changes, you can perform your processing.当日期更改时,您可以执行您的处理。
https://docs.microsoft.com/en-us/dotnet/api/system.threading.timer?view=net-5.0 https://docs.microsoft.com/en-us/dotnet/api/system.threading.timer?view=net-5.0
use background worker,使用后台工作者,
You can implement using the following method,您可以使用以下方法实现,
Include System.Threading namespace.包括 System.Threading 命名空间。
Apply the threading code as follows,应用线程代码如下,
Thread obj = new Thread(new ThreadStart());线程 obj = new Thread(new ThreadStart());
obj.IsBackground = true; obj.IsBackground = true;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.