473,399 Members | 3,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,399 software developers and data experts.

Call function at certian interval of time

Hi Everyone,

I am developing a application for my personal use. Basically what it
will do is grab still images from my webcam at a set interval of time.
And save them to me hard disk. The program then uploads the files to my
ftp server for inclusion on my website.

This part is all working fine, however, what I want to do next is upload
all photos created in the (for this purpose lets say) past hour (which
can be user defined), to a different directory on the ftp server, for
archive purposes. Now the upload isn't a issue, but I am unsure of how
to approach the performing of the upload at a certian interval of time
as provided by the user.
Obviously it would require some sort of timer to enable me to do this,
but I am totally new to C#.

I am not asking for people to write the code for me, I am just looking
for general idea on how to accomplish what I want.

I anticipate your responses

Regards
Mar 25 '06 #1
4 15624
I'm assuming this is a winforms app? Under the All Windows Controls tab in
the toolbox is a Timer control. Set the time interval to number of
milliseconds (i.e. 5 seconds = 5000 milliseconds) and tie the timer event to
a method in your form (or generate a new timer event method) and away you
go!

Robert

"Materialised" <ma**********@privacy.net> wrote in message
news:48************@individual.net...
Hi Everyone,

I am developing a application for my personal use. Basically what it will
do is grab still images from my webcam at a set interval of time. And save
them to me hard disk. The program then uploads the files to my ftp server
for inclusion on my website.

This part is all working fine, however, what I want to do next is upload
all photos created in the (for this purpose lets say) past hour (which can
be user defined), to a different directory on the ftp server, for archive
purposes. Now the upload isn't a issue, but I am unsure of how to approach
the performing of the upload at a certian interval of time as provided by
the user.
Obviously it would require some sort of timer to enable me to do this, but
I am totally new to C#.

I am not asking for people to write the code for me, I am just looking for
general idea on how to accomplish what I want.

I anticipate your responses

Regards



----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Mar 25 '06 #2
n4ixt wrote:
I'm assuming this is a winforms app? Under the All Windows Controls tab in
the toolbox is a Timer control. Set the time interval to number of
milliseconds (i.e. 5 seconds = 5000 milliseconds) and tie the timer event to
a method in your form (or generate a new timer event method) and away you
go!

Robert

Hi Robert,

Thanks for your reply.

A while back I used to do some VB 6 work, before migrating to C on Unix
platforms, and if I recall correctly, the VB timer control was limited
to a certain relatively small frame of time. Is this the case with the
..net timer control? As rather than periods of milliseconds I am looking
to work over periods of hours.

Kind Regards
Mar 25 '06 #3
Hi Materialised,
the VB timer control was limited
to a certain relatively small frame of time. Is this the case with the
.net timer control? As rather than periods of milliseconds I am looking
to work over periods of hours.


Since your interval period is so large, I can think of three options
that you can consider :

1. Use the System.Timers.Timer component (located on the Components tab
of the Toolbox) and not the System.Windows.Forms.Timer component. The
former is an enhanced version of the VB 6.0 control. It does not have
the same limitations that the latter does.

2. Derive your own Timer from the Timer class, improvising it to suit
your particular needs.

3. Search for a free Timer control on the net :
This article on Codeproject explains how to build one -
http://www.codeproject.com/dotnet/AB...ockArticle.asp

I also found the following article which explains how to use the
standard timer in a large interval time frame.

http://searchvb.techtarget.com/tip/1...my=%2Fpr%2F4f0

Hope this information helps,

Regards,

Cerebrus.

Mar 25 '06 #4
Cerebrus wrote:
Hi Materialised,
the VB timer control was limited
to a certain relatively small frame of time. Is this the case with the
.net timer control? As rather than periods of milliseconds I am looking
to work over periods of hours.


Since your interval period is so large, I can think of three options
that you can consider :

1. Use the System.Timers.Timer component (located on the Components tab
of the Toolbox) and not the System.Windows.Forms.Timer component. The
former is an enhanced version of the VB 6.0 control. It does not have
the same limitations that the latter does.

2. Derive your own Timer from the Timer class, improvising it to suit
your particular needs.

3. Search for a free Timer control on the net :
This article on Codeproject explains how to build one -
http://www.codeproject.com/dotnet/AB...ockArticle.asp

I also found the following article which explains how to use the
standard timer in a large interval time frame.

http://searchvb.techtarget.com/tip/1...my=%2Fpr%2F4f0

Hope this information helps,

Regards,

Cerebrus.

Thanks for your reply Cerebrus, I will look into all the options and let
you know how I get one.

Once again thank you.

Kind Regards
Materialised
Mar 25 '06 #5

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

Similar topics

6
by: Penguin | last post by:
At some long ago time Steve Jorgensen answered thus: Subject: Re: How can I round a time? Newsgroups: comp.databases.ms-access Date: 1998/12/11 Access represents a date internally as a double...
4
by: ey.markov | last post by:
Greetings, I have an A2K application where for a report the user enters a month-end date, and the system must gather transactions for that month. No problem, I thought, I'll just use the DateAdd...
33
by: Pushkar Pradhan | last post by:
I'm using clock() to time parts of my code e.g. clk1 = clock(); /* code */ clk2 = clock(); /* calculate time in secs */ ...... clk1 = clock(); /* code */ clk2 = clock();
0
by: Ian E. Morgan | last post by:
After being frustrated with the inflexible output of intervals, I've written a pl/pgsql function to do what I want, and hopefully some other people might find it useful. Output is a string that...
2
by: Ron St-Pierre | last post by:
I have a simple function which I use to set up a users' expiry date. If a field in a table contains an interval then this function returns a timestamp some time in the future (usually two weeks),...
9
by: Jordan Pittman | last post by:
ok i want to wait an x amout of seconds before my ajax script writes the results to a div, but i want it to still display the loading bar, i do have a variable http_rste that holds the readyState...
14
by: amit.man | last post by:
Hello i need to write a MACRO function that look something like this """ do_somthing(); for(int i=0;i<100;i++) {do_something_else())} return(somthing_other_then_those()) // a double type """
2
by: dwasbig9 | last post by:
Hi Group (fairly limited knowledge of Access and almost none of Access VBA. Using Access 2003). I need to sum time, I've found through the groups archive an sql extract that led me to this ...
6
by: Janwillem Borleffs | last post by:
Tuxedo schreef: You can check the Image.complete property; example: img = new Image(100,100); interval = setInterval('checkcomplete()', 100); img.src = 'someimg'; function checkcomplete()...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.