在Web应用程序中的周期性任务子系统子系统、周期性、应用程序、任务

2023-09-05 23:25:30 作者:哥一上线。全国停电

要为precise:我有一个.NET Web表单系统。我需要一种方法来检查的一些价值观和执行任务,这取决于周期性的方式处理这些值。比方说:我每个月要检查,如果我的客户的信用卡仍然有效。还有一些其他的任务/检查时间很短。

To be precise: I have a .NET web forms system. I need a way to check some values and perform tasks, depending on these values in periodic manner. Let's say: Every month I have to check if my customers credit cards are still valid. There some other tasks/checking in short periods.

什么是这个问题的最好的办法。我想到了Windows服务,但我了解WCF。请指教一下是现代和良好的方法来解决这个任务。我在想.NET 4.0。

What is the best approach to the subject. I thought about Windows Service but I read about WCF. Please advise what is the modern and good way to solve this task. I'm thinking about .NET 4.0.

推荐答案

WCF就是能够在任何Windows服务或IIS中运行的接口。您可以使用此WCF接口来引发一些同步或异步操作。

WCF is just an interface that can run in either Windows Service or IIS. You use this WCF interface to trigger some synchronous or asynchronous actions.

您的情况听起来好像你在计时器希望Windows服务来存储在数据库或文件中的数据进行验证。

Your case sounds like you want a Windows Service on timer to perform validation on data stored in a data base or file.

如果你想按需启动一个进程,然后添加一个WCF终结可能是有用的,如果定时器的做法是不够好,那么你不必费心与WCF。

If you want to start a process on demand then adding a WCF endpoint might be useful, if the timer approach is good enough, then you need not bother with WCF.

在Windows进程托管WCF引用

References for hosting WCF in Windows Process

microsoft.com $ C $的CProject。 COM microsoft.com codeproject.com