如何每天在特定时间在c#.net中启动操作 [英] How initiate an action at a particular time every day in c#.net

查看:81
本文介绍了如何每天在特定时间在c#.net中启动操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望每天在特定时间执行某项操作,例如sql中的触发器,但是在这里我希望在c#.net中做到这一点,请问有人可以帮助我吗,

谢谢

I am looking to do an action on every day at a particular time like triggers in sql, but here i am looking to do this in c#.net, can any one please help me,

Thanks

推荐答案

尝试任务计划程序托管包装器 [ Windows服务 [ http://msdn.microsoft.com/en-us/library/d56de412(VS.80).aspx [ ^ ]

这是一些显示以下内容的文章:
使用C#Windows服务结合数据库电子邮件记录PART – II异步发送自动电子邮件 [任务计划程序(Windows) [ ^ ]
关于任务计划程序与Windows服务的比较 [使用ASP.NET模拟Windows服务以运行计划的作业 [ CodeProject答案 [ ^ ]来问类似的问题.
Try Task Scheduler Managed Wrapper[^]. This library will surely fulfill all your needs regarding Scheduled Jobs.

Windows Service[^] is an alternative for similar stuff.
Refer more: http://msdn.microsoft.com/en-us/library/d56de412(VS.80).aspx[^]

Here are some articles which shows:
Sending Automated Emails asynchronously using a C# Windows Service in conjunction with Database Email records – Part I[^]
Sending Automated Emails asynchronously using a C# Windows Service in conjunction with Database Email records PART – II[^]

Alternatively, you may use Task Scheduler (Windows)[^]
A comparison about Task Scheduler vs Windows Service[^]

BTW found a nice article in CP
Simulate a Windows Service using ASP.NET to run scheduled jobs[^]

Check out CodeProject Answers[^] for similar question asked before.


1.)使用Windows服务.
2.)使用Windows Schedular计划您的应用程序.
1.) Use a windows service.
2.) Schedule your application using Windows Schedular.


这取决于操作本身.例如:
-SQL Server:在SQL Server代理中安排作业( http://msdn.microsoft.com/en-我们/library/ms191439.aspx [ ^ ], SQL代理:作业调度程序框架 [ ^ ]))
-使用计划程序服务(针对的新任务计划程序类库. NET [ ^ ], http://kodethoughts.blogspot. fr/2009/06/creating-windows-task-scheduler-service.html [ http://taskscheduler.codeplex.com/ [
It depends on the action itself. Ex:
- SQL Server: Schedule a job in SQL Server Agent (http://msdn.microsoft.com/en-us/library/ms191439.aspx[^], SQL Agent: A Job Scheduler Framework[^])
- Using a scheduler service (A New Task Scheduler Class Library for .NET[^], http://kodethoughts.blogspot.fr/2009/06/creating-windows-task-scheduler-service.html[^] )
- Using the system task scheduler: http://taskscheduler.codeplex.com/[^]

So if your purposes does not fit in the scope of these approaches, please elaborate your question a little more.


这篇关于如何每天在特定时间在c#.net中启动操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆