89 lines
3.8 KiB
VB.net
89 lines
3.8 KiB
VB.net
Imports System.IO
|
|
|
|
Public Class Form199
|
|
Private Sub Form199_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
|
Dim lines1() As String = File.ReadAllLines(théme)
|
|
|
|
If lines1(0) = 2 Then
|
|
Me.BackColor = Color.FromArgb(64, 64, 64)
|
|
Label1.BackColor = Color.FromArgb(64, 64, 64)
|
|
Button1.BackColor = Color.FromArgb(64, 64, 64)
|
|
ComboBox1.BackColor = Color.FromArgb(64, 64, 64)
|
|
Label1.ForeColor = Color.White
|
|
ComboBox1.ForeColor = Color.White
|
|
Button1.ForeColor = Color.White
|
|
ElseIf lines1(0) = 3 Then
|
|
Me.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
Label1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
Button1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
ComboBox1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
Label1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
ComboBox1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
Button1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
End If
|
|
|
|
ComboBox1.Items.Clear()
|
|
For Each fichier As String In IO.Directory.GetDirectories(dosprofils)
|
|
Dim info As New IO.DirectoryInfo(fichier)
|
|
ComboBox1.Items.Add(info.Name)
|
|
Next
|
|
|
|
ComboBox1.Items.Remove(nomprofils)
|
|
|
|
If ComboBox1.Items.Count = 0 Then
|
|
MsgBox("Aucun profil trouvez", MsgBoxStyle.Information)
|
|
Close()
|
|
Else
|
|
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
|
|
|
If ComboBox1.SelectedItem = "" Then
|
|
MsgBox("Merci de sélectionnez un profil", MsgBoxStyle.Exclamation)
|
|
Else
|
|
Dim msg = MsgBox("Voulez-vous vraiment supprimer le profil: " & ComboBox1.SelectedItem & vbNewLine & "tout le donné liées au profil seront supprimer", MsgBoxStyle.YesNo)
|
|
If msg = MsgBoxResult.Yes Then
|
|
|
|
For Each fichier As String In IO.Directory.GetFiles(dosprofils & ComboBox1.SelectedItem)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
File.Delete(fichier)
|
|
Next
|
|
|
|
For Each fichier1 As String In IO.Directory.GetDirectories(dosprofils & ComboBox1.SelectedItem)
|
|
Dim info As New IO.FileInfo(fichier1)
|
|
Directory.Delete(fichier1, recursive:=True)
|
|
Next
|
|
|
|
Directory.Delete(dosprofils & ComboBox1.SelectedItem)
|
|
MsgBox("Le profil: " & ComboBox1.SelectedItem & " a bien été supprimer", MsgBoxStyle.Information)
|
|
|
|
Close()
|
|
Else
|
|
MsgBox("Action annuler", MsgBoxStyle.Information)
|
|
End If
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub Form199_Closed(sender As Object, e As EventArgs) Handles Me.Closed
|
|
ComboBox1.Items.Clear()
|
|
For Each fichier As String In IO.Directory.GetDirectories(dosprofils)
|
|
Dim info As New IO.DirectoryInfo(fichier)
|
|
ComboBox1.Items.Add(info.Name)
|
|
Next
|
|
|
|
coutprofils = ComboBox1.Items.Count
|
|
|
|
Form3.Label43.Text = "Nombre de profils: " & coutprofils
|
|
|
|
ComboBox1.Items.Remove(nomprofils)
|
|
|
|
If ComboBox1.Items.Count = 0 Then
|
|
Form1.ChangerDeProfilsToolStripMenuItem.Visible = False
|
|
Else
|
|
Form1.ChangerDeProfilsToolStripMenuItem.Visible = True
|
|
End If
|
|
ComboBox1.Items.Clear()
|
|
End Sub
|
|
End Class |