开发者

What would be the best approach is my application had to pull information from a website every day at 2am

开发者 https://www.devze.com 2022-12-17 00:07 出处:网络
I\'m making a small application that is supposed to download info from the web every day at 2am. It will download the information and write the strings to an XML file of my choosing.

I'm making a small application that is supposed to download info from the web every day at 2am. It will download the information and write the strings to an XML file of my choosing.

Using .NET and C#.

My initial approach was to install a service on the users computer and have that run, but I'm not so sure. I've not even used it so much in the past, only once.

Which is the best (read: time tested :P ) approach to this v开发者_JAVA百科ery common problem.


You can either build your application as a Windows Service, as you mentioned.

Or else it would probably be a better idea to create a normal console application, and launch it automatically at 2.00am with the Windows Task Scheduler.

You can consider both methods as popular and "time-tested".


I would suggest having a console app, which calls data fetching algo in a separate public class (not the main method).

Like Daniel mentioned, run it via Windows Task Scheduler which itself will take care of most scheduling requirements.

This allows the solution to be scaled in the future if need be. E.g. convert into Windows Service, full GUI Winform or even SQL server scheduled tasks etc.

0

精彩评论

暂无评论...
验证码 换一张
取 消