Files
2026-06-18 14:15:48 +02:00

64 lines
2.4 KiB
VB.net

Imports System.ComponentModel
Imports System.IO
Public Class Form179
Dim dl As Integer = 1
Private Sub BackgroundWorker1_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
Dim sw1 As New StreamWriter(lastedbackup)
sw1.WriteLine(1)
sw1.WriteLine(Today.Day)
sw1.WriteLine(Today.Month)
sw1.WriteLine(Today.Year)
sw1.WriteLine(TimeOfDay.Hour)
sw1.WriteLine(TimeOfDay.Minute)
sw1.Close()
Compression.ZipFile.CreateFromDirectory(repertoireavis, mesbacup & "\lecteur média backup du " & Today.Day & "-" & Today.Month & "-" & Today.Year & " a " & TimeOfDay.Hour & "h" & TimeOfDay.Minute & ".zip")
End Sub
Private Sub Form179_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim lines1a() As String = File.ReadAllLines(théme)
If lines1a(0) = 2 Then
Me.BackColor = Color.FromArgb(64, 64, 64)
ElseIf lines1a(0) = 3 Then
Me.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
Else
End If
BackgroundWorker1.RunWorkerAsync()
End Sub
Private Sub BackgroundWorker1_RunWorkerCompleted(sender As Object, e As RunWorkerCompletedEventArgs) Handles BackgroundWorker1.RunWorkerCompleted
dl = 0
MsgBox("La sauvegarde en cours c'est effectuer avec sucées", MsgBoxStyle.Information)
Form3.ListBox5.Items.Clear()
For Each fichier As String In IO.Directory.GetFiles(mesbacup)
Dim info As New IO.FileInfo(fichier)
Form3.ListBox5.Items.Add(info.Name)
Next
Dim lines6() As String = File.ReadAllLines(lastedbackup)
If lines6(0) = 1 Then
Form3.Label41.Text = "Dernière sauvegarde: Le " & lines6(1) & "/" & lines6(2) & "/" & lines6(3) & " a " & lines6(4) & "h" & lines6(5)
Form3.Label41.Show()
Else
Form3.Label41.Hide()
End If
Form3.Button25.Text = "Modifier la sauvegarde"
Form3.Button26.Show()
Form3.Button31.Show()
Form177.Close()
Close()
End Sub
Private Sub Form179_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
If dl = 1 Then
e.Cancel = True
MsgBox("Une sauvegarde est en cours, merci de patienter", MsgBoxStyle.Information)
Else
End If
End Sub
End Class