Imports System.IO Public Class renomer_la_radio Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim t7 = TextBox1.Text Dim t1 = radio Dim t2 = Form3.ComboBox6.SelectedItem Dim t3 = t1 & t2 Dim t9 = t1 & t7 If TextBox1.Text.Contains("/") Or TextBox1.Text.Contains("\") Or TextBox1.Text.Contains(":") Or TextBox1.Text.Contains("*") Or TextBox1.Text.Contains("?") Or TextBox1.Text.Contains("""") Or TextBox1.Text.Contains("<") Or TextBox1.Text.Contains(">") Then MsgBox("Les caractères /\ : * <> """" et ? sont interdit", MsgBoxStyle.Exclamation) Exit Sub End If If TextBox1.Text = "RFM" Or TextBox1.Text = "RMC" Or TextBox1.Text = "Chérie" Or TextBox1.Text = "Nostalgie France" Or TextBox1.Text = "NRJ France" Or TextBox1.Text = "Rire & Chansons" Or TextBox1.Text = "France Info" Or TextBox1.Text = "Fun Radio France" Or TextBox1.Text = "RTL" Or TextBox1.Text = "Ouï FM" Then MsgBox("La radio: " & t7 & " existe déjà", MsgBoxStyle.Exclamation) Exit Sub End If If TextBox1.Text = "" Then MsgBox("Merci entrer un nom", MsgBoxStyle.Information) Exit Sub End If If Directory.Exists(t9) = True Then MsgBox("La radio: " & t7 & " existe déjà", MsgBoxStyle.Exclamation) Exit Sub Else For Each fichier As String In IO.Directory.GetDirectories(radio) Dim info As New IO.FileInfo(fichier) Form1.ComboBox1.Items.Remove(info.Name) Form8.ComboBox1.Items.Remove(info.Name) Next My.Computer.FileSystem.RenameDirectory(t3, TextBox1.Text) MsgBox("La radio a bien été renommer", MsgBoxStyle.Information) Form3.ComboBox6.Items.Clear() Form3.ComboBox5.Items.Clear() For Each fichier As String In IO.Directory.GetDirectories(radio) Dim info As New IO.FileInfo(fichier) Form3.ComboBox6.Items.Add(info.Name) Form3.ComboBox5.Items.Add(info.Name) Form1.ComboBox1.Items.Add(info.Name) Form8.ComboBox1.Items.Add(info.Name) Next Form3.ComboBox6.SelectedItem = TextBox1.Text End If Close() End Sub Private Sub renomer_la_radio_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) Button1.BackColor = Color.FromArgb(64, 64, 64) Button1.ForeColor = Color.White Label1.ForeColor = Color.White TextBox1.BackColor = Color.FromArgb(64, 64, 64) TextBox1.ForeColor = Color.White ElseIf lines1a(0) = 3 Then Me.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) Button1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) Button1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) Label1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) TextBox1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) TextBox1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) End If End Sub End Class