473,322 Members | 1,398 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Question: Timer available for console application?

I'm creating a console application. Can I use a timer control to do
something every 5 seconds?
Nov 20 '05 #1
4 8079
VB Programmer,
Remember there are 3 different Timer objects in .NET.

For a console application I would not use the System.Windows.Forms.Timer
class, as this class is based on Forms, which means you need to get
Application.Run involved.

I would recommend using either System.Threading.Timer class or the
System.Timers.Timer class. Be sure to read about both as they use multiple
threads to handle the event.

Hope this helps
Jay

"VB Programmer" <gr*********@go-intech.com> wrote in message
news:eM*************@tk2msftngp13.phx.gbl...
I'm creating a console application. Can I use a timer control to do
something every 5 seconds?

Nov 20 '05 #2
"VB Programmer" <gr*********@go-intech.com> schrieb
I'm creating a console application. Can I use a timer control to
do something every 5 seconds?


System.Timers.Timer in assembly System.dll
--
Armin

Nov 20 '05 #3
Thanks guys!

"VB Programmer" <gr*********@go-intech.com> wrote in message
news:eM*************@tk2msftngp13.phx.gbl...
I'm creating a console application. Can I use a timer control to do
something every 5 seconds?

Nov 20 '05 #4
Hello,

"VB Programmer" <gr*********@go-intech.com> schrieb:
I'm creating a console application. Can I use a timer control
to do something every 5 seconds?


System.Timers.Timer
System.Threading.Timer
System.Windows.Forms.Timer (for use with Windows Forms applications)

HTH,
Herfried K. Wagner
--
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: avivgur | last post by:
Hello, I have devised a console application that uses a System.Timers.Timer and its Elapsed event. The problem is that I want the program to continue to run so that each time the event is raised,...
3
by: jam | last post by:
Dear all, I am wrtiing a console application and doing some test on timer, the below is my sample code I got from some site, but I cannot make it work... Error is 'System.Timers.Timer' does not...
7
by: Noozer | last post by:
I have a timer on a form. It isn't firing at all. I know that the timer is enabled, and that the interval is low (4000, which should be 4 seconds). To ensure the timer wasn't being inadvertantly...
6
by: Aart Nicolai | last post by:
Hi all, I have developed a vb.net console application which will run some code every seconds. To get this working I used a timer "System.Timers". When I start my console application it exits...
4
by: archana | last post by:
Hi all I am having application which is using server based timer that is timer from namespace system.timer. I am having windows service which i want to run after every 1 hour and after...
8
by: =?Utf-8?B?RGF2ZSBCb29rZXI=?= | last post by:
I have a Timer that I set to go off once a day, but it frequently fails! In order to debug I would like to be able to check, at any moment, whether the Timer is enabled and when it will next...
4
by: Lauren Quantrell | last post by:
I have just put together a vb.net app and now need to provide it to users. This application needs to run the code in a sub every 60 seconds from a Windows Service application. I have the...
10
by: Joris De Groote | last post by:
Hi, I have wrote a program that checks for files and moves these files to the correct folders when they come in. Everything works fine. However I always have to start that program manually. I...
15
by: Scott M. | last post by:
Hi, I'm an old VB6 guy just starting out in VB.Net using Visual Studio Express. I want to build a simple console app that will create a simple text file every 10 minutes. I can create the file...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.