Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to add a timer component/control to a Windows Service project

Status
Not open for further replies.

ericnet

Programmer
Mar 29, 2006
106
I recently downloaded SharpDevelop 1.1 in order to create a Windows Service to collect, monitor and store into SQL database performance counter values of my server. Now I am doing my first steps creating a Windows Service example, but I don’ t know how to add a timer component/control to my recently created Windows Service. Somebody knows which are the steps in SharpDevelop design window to add that timer component to a Windows Service project? Or how to do it in Visual Studio so that I can deduce how to do it in SharpDevelop?

I am following the instructions of this article to create that Windows Service example, and it is explained using Visual Studio. The part of the instructions that explains how to add the timer control says:
..Open Visual Studio .NET and create a new Windows service project, which we shall call "MyService". Click OK.
Add a timer control from the toolbar in the Components tab. In the properties window of Timer1, change the interval property to 10000, which is 10 seconds...

Another article I found, says more or less the same:
Well, start off by creating your own Windows Service project in Visual Studio .NET.....One of the most common procedures in designing your Windows service is to add a Timer component and have it fire your service code every x seconds or minutes. How can you get this to work? While still in Design mode, open the Components tab of the toolbox and drag and drop a Timer component onto your service. Change its Interval property to the number of milliseconds between times you want your code to run. (Remember, 1,000 milliseconds equals one second. If you want your code to run every ten minutes, for example, set this to 60000.)...

Here is the complete article:
Which are the steps to follow (with either Visual Studio or SharpDevelop) to create that Timer component? I successfully created the Windows Service, and now I see the vb code file created by SharpDevelop, but I don’ t absolutely find how to add that Timer..

Thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top