简体   繁体   English

当今天更改为第二天时,如何在 asp.net 中触发事件?

[英]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,您可以使用以下方法实现,

  1. Include System.Threading namespace.包括 System.Threading 命名空间。

  2. 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.

相关问题 如何在ASP.NET中触发自定义验证器事件? - How to get custom validator event to fire in asp.net? 如何从ASP.NET中的JavaScript触发按钮单击事件 - How to fire a button click event from JavaScript in ASP.NET asp.net按钮/ htmlbutton事件不会触发 - asp.net button/htmlbutton event will not fire 无法触发asp.net的itemcommand事件 - Cannot fire itemcommand event asp.net 如何在项目Asp.net MVC4的服务器端手动触发回发事件以激活selectedIndexChanged事件 - How to manually fire postback event to activate selectedIndexChanged event on the server side of a project Asp.net mvc4 当 javascript function 添加到 web 页面时,ASP.Net OnTextChanged 事件不会触发 - ASP.Net OnTextChanged event doesn't fire when javascript function added to web page 取消选中时,ASP.NET C#CheckBox不会触发CheckedChanged事件 - ASP.NET C# CheckBox does not fire CheckedChanged event when unchecking 在 ASP.Net 中动态取消选中复选框时,CheckBox 不会触发 CheckedChanged 事件 - CheckBox does not fire CheckedChanged event when unchecking the checkbox Dynamically in ASP.Net 当onkeyup事件定义“ setTimeout”(IE9)时,ASP.NET / Webform文本框不会触发自动回发 - ASP.NET/Webform Textbox does not fire the autopostback when onkeyup event defines “setTimeout” (IE9) 什么时候确切地在ASP.NET的FormView中触发OnItemUpdated事件? - When exactly does the OnItemUpdated event fire specifically in a FormView in ASP.NET?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM