473,322 Members | 1,401 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.

Console App Theory

Dan
I have been struggling with a console app that I have written. Perhaps there are some gurus out there that can clear up a few things for me. My history is with VB where you have a form and a butt on and so on. When you click, load, change a control you can run some code with that event. I am hoping that I can translate that sort of functionality to a console app and eventually a service. I want to have, say, a timer control in my console app that runs a bit of code every 5 seconds. So the two questions are how do I start a console app and have it just"sit there" without using 100% cpu until some event fires. And secondly how do you "create" events in a console app? Specifically I am looking at the timer class and the udpclient class. Any thoughts and/or general direction is appreciated

Thanks
Dan
Nov 20 '05 #1
1 906
On 2004-03-03, Dan <an*******@discussions.microsoft.com> wrote:
I have been struggling with a console app that I have written. Perhaps there are some gurus out there that can clear up a few things for me. My history is with VB where you have a form and a butt on and so on. When you click, load, change a control you can run some code with that event. I am hoping that I can translate that sort of functionality to a console app and eventually a service. I want to have, say, a timer control in my console app that runs a bit of code every 5 seconds. So the two questions are how do I start a console app and have it just"sit there" without using 100% cpu until some event fires. And secondly how do you "create" events in a console app? Specifically I am looking at the timer class and the udpclient class. Any thoughts and/or general direction is appreciated.

Thanks!
Dan


Use the formless timers... Either System.Threading.Timer or
System.Timers.Timer... Windows.Forms.Timer won't work for you, since
there is no message loop in a console app.

--
Tom Shelton [MVP]
Powered By Gentoo Linux 1.4
"Zaphod grinned two manic grins, sauntered over to the bar
and bought most of it."

- Zaphod in paradise.
Nov 20 '05 #2

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

Similar topics

1
by: Xah Lee | last post by:
Dear functional programing comrades, Among the community of automatons of the IT industry, there is a popular quote about "theory vs practice" that goes something along the lines of "in theory...
8
by: Amelyan | last post by:
I need some help to confirm my theory! I think I discovered something new for myself about behavior System.Web.UI.Page. THEORY: Every time I change control on my WebForm1 page that results in...
4
by: Bob | last post by:
I just recently noticed that when I start my applicatoin in debug mode, the IDE hangs (no disk or CPU activity) indefinitely (at least 20 minutes). Pausing the application shows that it's hung up...
8
by: bhagyamesh | last post by:
dear sir/madam, AS I START TO DEBUG ANY PROGRAM IN C# CONSOLE, PC GETS RESTART. PLZ HELP ME OUT. Thanks in Advance.
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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.