Solved

I need to backup several files at a specific time - need help with creating a VB.NET program with a timer?

Posted on 2007-04-09
4
148 Views
Last Modified: 2013-11-26
I need help creating a VB.Net 2003 form that runs in the background - every now and then checks the desktop time to see if 11:00 p.m. and if so then run a function that backups several files in an Access database.  I already know how I want to create my function and I've develop programs in Visual Basic 6 before but I acknowledge VB.NET is different.    I'm thinking that I need to add a timer that (of which I've done already with an interval of 6000) but unsure the exact length of time that will entail or how to check that if say the time is past 11:00 p.m. when the timer is fired?  I think that the interval 6000 would slow other processes down since this will be a program running in the background and I don't want it to slow down any other processes I have running at the same time.  Basically the code to get me started is pasted below:

Private Sub tmrCheckTime_Elapsed(ByVal sender As System.Object, ByVal e As System.Timers.ElapsedEventArgs) Handles tmrCheckTime.Elapsed

End Sub
0
Comment
Question by:stephenlecomptejr
  • 2
  • 2
4 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 18877451
why don't you use the scheduler to launch your task?
0
 
LVL 1

Author Comment

by:stephenlecomptejr
ID: 18877744
What is the scheduler that you are talking about?  Is that a component?
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 18877906
The Windows Scheduler (look in your control panel to find it). You can run jobs from there. Your application does not need to take care of what time is it and so. It only has to focus on its own task.
0
 
LVL 1

Author Comment

by:stephenlecomptejr
ID: 18878258
Its listed as Scheduled Tasks.

As many times as I've gone into Control Panel - I've never noticed it or tried to use it before.

Thank you very much!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question