c# timing

Hi,

I am waiting for data from serial port, how can I set the timer for 5 minutes and quit if I
don't receive any data?

Thanks,
JT
jtran007Asked:
Who is Participating?
 
Praveen KumarConnect With a Mentor ArchitectCommented:
Set your timer Interval property to 300000 (milliseconds i.e. 5 mins)


If the timer event,

1. Stop the timer
2. try to read the data from serialport
3. if found process it and start the timer
4. if not found, start the timer
0
 
jimswebCommented:
The Timer control allows you to set a time interval to execute an event after that interval continuously. It is useful when you want to execute certain applications after a certain interval.

http://www.c-sharpcorner.com/UploadFile/mahesh/WorkingwithTimerControlinCSharp11302005054911AM/WorkingwithTimerControlinCSharp.aspx

http://www.csharphelp.com/2006/02/c-timer-demo/
0
 
jtran007Author Commented:
Hi,

Thanks. After timer expires, I'd like to grap a datafile located in the resources folder. How can I do it?

Thanks,
JT
0
 
dimajCommented:
What do you mean by "grap a datafile"?
0
 
jtran007Author Commented:
Thanks,
JT
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.