PC Review


Reply
Thread Tools Rate Thread

Console App Theory

 
 
=?Utf-8?B?RGFu?=
Guest
Posts: n/a
 
      3rd Mar 2004
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
 
Reply With Quote
 
 
 
 
Tom Shelton
Guest
Posts: n/a
 
      3rd Mar 2004
On 2004-03-03, Dan <(E-Mail Removed)> 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.
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SET THEORY & VBA ? jay dean Microsoft Excel Programming 5 30th Apr 2009 06:46 PM
IF/Then Theory between two or more tabs. ruaduck Microsoft Excel Worksheet Functions 3 28th May 2008 10:38 PM
Chaos theory masterkeedu Gaming 1 5th Nov 2005 10:43 AM
Theory question YYZ Microsoft VB .NET 2 3rd Jun 2004 04:48 PM
Import Theory Dennis Microsoft Access Queries 3 27th Mar 2004 04:35 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:54 AM.