如何在c#.net中自动执行作业计划? [英] How to Automate job scheduling in c#.net?

查看:201
本文介绍了如何在c#.net中自动执行作业计划?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我需要处理数据库中的数据并导入到文本文件,并且此文本文件应保存在服务器中.
文本文件需要自动生成.
我需要每天晚上12:00进行这项工作.
请任何人都可以为此提供示例.
在此先感谢您.

Hi,

I need to process data from the database and import to a text file and this text file should save in the server.
The text file need to be generated automatically.
I need to run this job every day night at 12:00 am.
Please any one can provide an example for this.
Thanks in advance.

推荐答案

您可以为此使用Windows Scheduler或Windows服务.到目前为止,您尝试了什么?
You can use windows scheduler or use a windows service for this. What have you tried so far?


从开始->控制面板->计划任务
双击添加计划任务

单击下一步"继续
单击浏览找到您的consil应用程序文件夹BIN/Debug/YourConsoleApplicationName.exe
单击下一步"继续,然后选择所需的应用程序运行时间或开始时间.
From Start -> Control Panel -> Scheduled tasks
Double click on ADD schedule Task

Click Next to continue
Click Browse to find your consil application folder BIN/Debug/YourConsoleApplicationName.exe
Click Next to continue, then select the desire run time or start time of your application.


只需为此过程构建一个简单的无头应用程序,然后使用Windows Task Scheduler对其进行计划,如下所示: Yogesh Singh Rawat.
确保您已经登录了这种类型的应用程序,以便可以查看事实之后的情况.
Just build a simple headless application for this process and then schedule it with the Windows Task Scheduler as outlined by Yogesh Singh Rawat.
Ensure that you have logging in this type of application so that you can check up on what it did after the fact.


这篇关于如何在c#.net中自动执行作业计划?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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