Avatar of jyothsna1803
jyothsna1803

asked on 

Windows service timer implementation

Hi,

I am writing a windows service. I want to run this service to ne run on 1st of every month. I would like to implement timer to achieve this.
Could you please tell me how to implement the timer, So my service will run on 1st of every monrh.
.NET ProgrammingEditors IDEsVisual Basic.NET

Avatar of undefined
Last Comment
William Domenz
Avatar of William Domenz
William Domenz
Flag of United States of America image

inside your trimer event ...  this is the event that gets raised at every X interval you set it to in milliseconds...
Perform a if DateTime.Now.Day = 1 then ....  go do your work
Note:
You will have to keep track that this has already run 'on this day' so that if the timer is set short enough to go off more than once per day, it does not run multiple times (unless this the action you are looking for).

BillyDvd
Avatar of jyothsna1803
jyothsna1803

ASKER

Do i need to tack timer tick events? How the service will run on 1st of every month automatically, Could you plz provide me some sample code.
ASKER CERTIFIED SOLUTION
Avatar of William Domenz
William Domenz
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo