简体   繁体   English

由Windows任务计划程序触发

[英]Trigger by Windows task scheduler

I am developing a web application with ASP.NET and SQL Server Express and I want to check a status in database. 我正在使用ASP.NET和SQL Server Express开发Web应用程序,我想检查数据库中的状态。 After two days data is saved, if status is not changed, I want to call another function like SendEmail() . 保存两天的数据后,如果状态未更改,我想调用另一个函数,例如SendEmail() I have to use Windows Task Scheduler, I researched it but it seems for C++ developers. 我必须使用Windows Task Scheduler,我对其进行了研究,但对于C ++开发人员而言似乎如此。 How can I relate Windows Task Manager and SQL Server Express, and how can I control a specific value for each row in a table? 如何关联Windows Task Manager和SQL Server Express,以及如何控制表中每一行的特定值?

You'll want a long running c# application, either a console app that doesn't go away, or a windows service that runs using windows services. 您将需要一个长期运行的c#应用程序,或者是不会消失的控制台应用程序,或者是使用Windows服务运行的Windows服务。

In that app, you connect to your DB, do your query, and act on it how you'd like. 在该应用程序中,您可以连接到数据库,进行查询,然后根据需要对其执行操作。

The other option is to write a normal c# app, that queries the DB, acts on the result. 另一种选择是编写一个普通的c#应用程序,该应用程序查询数据库,并对结果进行操作。 Then, simply schedule it in your windows scheduler (by hand) to run on whatever interval you'd like. 然后,只需在Windows调度程序中手动调度它(以手动方式),即可在任意间隔内运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM