By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,569 Members | 1,630 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,569 IT Pros & Developers. It's quick & easy.

Timer without form

P: n/a
Hi

I am writing a windows service and don't want a form or any other UI element
in it. How can I implement timer in this case to run a piece of code every
hour?

Thanks

Regards
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Use the Timer object from the toolbox's components group.

"John" <jo**@nospam.infovis.co.uk> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Hi

I am writing a windows service and don't want a form or any other UI
element
in it. How can I implement timer in this case to run a piece of code every
hour?

Thanks

Regards

Nov 20 '05 #2

P: n/a
On Thu, 15 Jul 2004 01:24:20 +0100, John wrote:
Hi

I am writing a windows service and don't want a form or any other UI element
in it. How can I implement timer in this case to run a piece of code every
hour?

Thanks

Regards


In a windows service, you'll want to use System.Timers.Timer or
System.Threading.Timer...

--
Tom Shelton [MVP]
Nov 20 '05 #3

P: n/a
Bob
Don't use a timer, sleep the thread.

System.Threading.Thread.CurrentThread.Sleep(New TimeSpan(1, 0, 0))

Bob

"John" <jo**@nospam.infovis.co.uk> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Hi

I am writing a windows service and don't want a form or any other UI element in it. How can I implement timer in this case to run a piece of code every
hour?

Thanks

Regards


Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.