如何使用计时器编写服务以频繁检查DB值 [英] How to write services with timers to frequently check DB values
本文介绍了如何使用计时器编写服务以频繁检查DB值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
一个简单的问题....
我需要用C#编写服务。该服务应具有特定的计时器,该计时器应检入DB并检索日期。
例如......在应用程序中,用户提供2天后提醒我在后台,2天后,我应该加载用户标记提醒的数据我应该显示标记数据1st。
什么是解决这个问题的最佳方法???
A quick question ....
I need to write services in C#. The service should have specific timer which should check in DB and retrieves the date.
For example... In application, the user gives "Remind me after 2 days" In background, after 2 days, I should load the data where the user marked remind me and should display the marked data 1st.
what would be the best method to solve this ???
推荐答案
第1步:从网络应用中,您需要将用户选择的值存储在数据库中(2天)。
< b>步骤2:您可以创建一个Windows服务,它将继续检查数据库,并触发特定事件(当特定日期到来时),并可以执行插入或更新。
Step 1: From the web app you need to store the user selected value in DB (2 days).
Step 2: You can create a Windows Service, which will keep on checking the DB, and fires a particular event (when that particular date comes), and may do an insert or update.
这篇关于如何使用计时器编写服务以频繁检查DB值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文