Connecting Tech Pros Worldwide Help | Site Map

Call function at certian interval of time

Materialised
Guest
 
Posts: n/a
#1: Mar 25 '06
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
n4ixt
Guest
 
Posts: n/a
#2: Mar 25 '06

re: Call function at certian interval of time


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" <materialised@privacy.net> wrote in message
news:48jfbtFkarv9U1@individual.net...[color=blue]
> 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[/color]




----== 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 =---
Materialised
Guest
 
Posts: n/a
#3: Mar 25 '06

re: Call function at certian interval of time


n4ixt wrote:[color=blue]
> 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
>[/color]
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
Cerebrus
Guest
 
Posts: n/a
#4: Mar 25 '06

re: Call function at certian interval of time


Hi Materialised,
[color=blue][color=green]
>> 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.[/color][/color]

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.

Materialised
Guest
 
Posts: n/a
#5: Mar 25 '06

re: Call function at certian interval of time


Cerebrus wrote:[color=blue]
> Hi Materialised,
>[color=green][color=darkred]
>>> 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.[/color][/color]
>
> 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.
>[/color]
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
Closed Thread