Hey guys, im semi-new to vb.net and heres what i got.
My dad asked me to make him a backup program, so i found an open source vb.net backup project. He was it to backup his specified files every night but only shutdown Monday Tuesday Wednesday Thursday.
This is what i got sofar
So 3 questions.
1) How do i make it so it backups up and shuts down at 12:00 AM
2) Is my shutdown code correct, meaning it will do the backup THEN shutdown and not shoot the code then shut down before its done.
3)... how do i make it only shutdown Monday T W T's
o.o....
My dad asked me to make him a backup program, so i found an open source vb.net backup project. He was it to backup his specified files every night but only shutdown Monday Tuesday Wednesday Thursday.
This is what i got sofar
VB.NET:
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
If DateTime.Now.Hour = Int32.Parse(12:00) Then
' If mirrorcopy then warn the user.
' Reset variables
_stopped = False
' Create the FileCopy class which will initiate the threads
CopyFiles = New FileCopy
CopyFiles.FromPath = FromPathTextbox.Text
CopyFiles.ToPath = ToPathTextbox.Text
CopyFiles.InitialMessage = "*** MODE IS WINFORMS ***"
If CopyFiles.MirrorCopy Then
CopyFiles.InitialMessage = "*** MODE IS WINFORMS - MIRROR COPY IS SET ***"
End If
If CopyFiles.QuietLog Then
CopyFiles.InitialMessage += vbCrLf & "Logging is quiet - not verbose."
Else
CopyFiles.InitialMessage += vbCrLf & "Logging is not quiet - its verbose."
End If
' Initiate the copy, count and mirror threads from the FileCopy class
CopyFiles.StartCopy()
WorkingBar.Minimum = 0
WorkingBar.Maximum = 100
WorkingLabel.Visible = True
WorkingBar.Visible = True
' Reset form controls
StartCopy.Enabled = False
StopCopy.Enabled = True
ViewLog.Enabled = True
System.Diagnostics.Process.Start("ShutDown", "/r")
End If
End Sub
So 3 questions.
1) How do i make it so it backups up and shuts down at 12:00 AM
2) Is my shutdown code correct, meaning it will do the backup THEN shutdown and not shoot the code then shut down before its done.
3)... how do i make it only shutdown Monday T W T's
o.o....