自动化流程 [英] Automating a process
本文介绍了自动化流程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
当用户点击页面上的按钮时程序从Ftp获取文件,然后读取文件并插入数据进入数据库表。
我想知道如何让这个过程在某个时刻自动运行?让我们说每天上午12:05
Hi
I currently have a process when a user clicks a button on the page the program fetches a file from via Ftp and then reads the file and inserts the data into a database table.
I would like to know how would I be able to let this process run automatically at a certain hour? lets say 12:05am daily
推荐答案
您可以使用专为类似目的而设计并与Windows捆绑在一起的Windows服务;你可以在不同的层面上使用它。它被称为Window Task Scheduler,请参阅 http://en.wikipedia.org/wiki/Windows_Task_Scheduler [ ^ ]。
首先,您可以使用命令行实用程序AT.EXE或CSHTASKS.EXE(替换AT.EXE)来安排事件,请参阅:
http://en.wikipedia.org/wiki/At_%28Windows%29 [ ^ ],
http://en.wikipedia.org/wiki/Schtasks [ ^ ],
http://technet.microsoft .com / zh-cn / library / bb490866.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/windows/desktop/bb736357%28v=vs.85%29 .aspx [ ^ ]。
您还可以使用Window Task Scheduler API,请参阅:
http://msdn.microsoft.com/en-我们/ library / windows / desktop / aa383614%28v = vs.85%29.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/windows/desktop/aa383608%28v= vs.85%29.aspx [ ^ ] 。
要了解如何在.NET中使用它,请参阅此CodeProject文章:用于.NET的新任务计划程序类库 [ ^ ]。
-SA
You can use the Windows Service which is designed for similar purposes and bundled with Windows; you can use it on different levels. It is called Window Task Scheduler, see http://en.wikipedia.org/wiki/Windows_Task_Scheduler[^].
First, you can schedule events using command-line utilities AT.EXE or CSHTASKS.EXE (which is replacing AT.EXE), see:
http://en.wikipedia.org/wiki/At_%28Windows%29[^],
http://en.wikipedia.org/wiki/Schtasks[^],
http://technet.microsoft.com/en-us/library/bb490866.aspx[^],
http://msdn.microsoft.com/en-us/library/windows/desktop/bb736357%28v=vs.85%29.aspx[^].
And you also can use Window Task Scheduler API, please see:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa383614%28v=vs.85%29.aspx[^],
http://msdn.microsoft.com/en-us/library/windows/desktop/aa383608%28v=vs.85%29.aspx[^].
To see how can you use it with .NET, see this CodeProject article: A New Task Scheduler Class Library for .NET[^].
—SA
你可以使用 CSTaskScheduler
任务 [ ^ ]。
这篇关于自动化流程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文