wintimer

  • Thread starter Thread starter luca
  • Start date Start date
L

luca

hi all i have a question with win form and timer..

The situation: i have a winform c# application (developped with visual
studio 2005) which has to check the status of an internet connection on
regular intervals. If the connection is avaible the application has to
connect to a database to downloading some data.

my problem: i use a timer of the class system.windows.forms.timer and i
check the connection every tickevent : this operation is managed by the
same thread of the user interface? so this can slow the responsivness
of the application?

an other solution i have thinked : every tick event i start a
backgroundworker which check the connection and if it is possible makes
some operation with database. Is this a dummy idea?

Do you have some suggetion to solve my problem in the best way?

Sorry for possible mistakes...i am italian
 
The System.Timers.Timer class does not depend on the message pump and calls
the elapsed event on another thread. This sort of timer is more suitable for
such an application.

See System.Threading.Timer too.


--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
Back
Top