المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Oldie (as opposed to a newbie) trying to write a Windows Service



C# Programming
07-20-2010, 05:52 PM
So I'm a programmer who's been programming for 20 years. I have written Windows services numerous times and need to do it again. There are things that my service code doesn't do (like run in console mode) that I'd like it to do.

So does anybody have any code that I can steal that is the basis for a Windows service? I know I can create a new project as a Windows Service through VS2010 but was wondering if anybody has a basis I can use.

Also - the premise I used was in the OnStart command, start a timer that would run a routine that would poll for things to do. The routine would never end and check, based on time, if something needs to be done. Is this still an appropriate method for doing a service or is there a better way?

TIA - Jeff.