' We leave the default 1900/01/01 StartDate since we want to start the backups
' as soon as the scheduler is started (and every minute thereafter). Since
' we set the 'Required' property to true, a backup will be made immediately
' when the scheduler is started, because the backup due on 1900/01/01 has not
' yet been performed and cannot be skipped
' Next we assign the scheduled job to the backup library's list of
' scheduled jobs that it must monitor
Call xMain.ScheduledJobs.Add(xScheduled)
' For the first run, the text field contains the default text
' "This is the original text", which is saved to the text file
' (and therefore backed up). The "Dirty" variable lets us know
' if the text box contains new, changed text. If Dirty=True,
' then the text will be saved to the text file again, and since
' we have an incremental backup every minute, it will be backed up.
If Len(txtText.Text) <> 0 Then
Dirty = True
End If
' Finally, start the library's scheduler. Since we start it when the
' form is created, we'll be stopping the scheduler when the form is
' destroyed (in the Form_Unload event)
xMain.StartScheduler
End Sub
Private Sub Form_Unload(Cancel As Integer)
' Stop the Xceed Backup Scheduler
xMain.StopScheduler (True)
' We put True in order to allow the scheduler
' the chance to complete a potentially running backup job
' before stopping the scheduler and completing the above call.
End Sub
Private Sub Label2_Click()
End Sub
Private Sub Timer1_Timer()
' The timer is only used to update the "clock" on the form.
' (not to perform timing for backup jobs...)
lblClock = "Time: " + CStr(Now)
End Sub
Private Sub txtText_Change()
' When the text field has changed, we set Dirty=True, so that
' the text will be saved to the text file for backup purposes.
Dirty = True
End Sub
Private Sub txtText_KeyPress(KeyAscii As Integer)
lblProgress.Caption = ""
End Sub
Private Sub xMain_ProcessCompleted(ByVal lFilesTotal As Long, ByVal lFilesProcessed As Long, ByVal lFilesSkipped As Long, ByVal lBytesTotal As Long, ByVal lBytesProcessed As Long, ByVal lBytesSkipped As Long, ByVal xResult As XceedBackupLibCtl.bkpError)
Dim CompletionMessage As String
' When a job comnpletes, we get this event, and we can display
' the results to the user. We know which type of job has completed
Private Sub xMain_StartingBackup(ByVal xBackupJob As XceedBackupLibCtl.IXceedBackupJob, ByVal dtBackupDate As Date, sMediaLabelPattern As String, bPreventLaunch As Boolean)
Dim nFileNumber As Integer
' Let's save the text field to file if necessary, before the backup starts
If Dirty Then
nFileNumber = FreeFile
Open App.Path & "\TextField.txt" For Output As nFileNumber