tags:

views:

68

answers:

2

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 very common problem.

+4  A: 

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".

Daniel Vassallo
That sounds like a much simpler idea. I'll take it into consideration for sure. I want to see other options though.
Sergio Tapia
I personally would make a winforms app just to make it a little more personable and interactive with the capability to run in the background without interactivity, but I agree with this one. + 1
Joel Etherton
A: 

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.

o.k.w