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
141 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 69

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 69

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now