Imports System.IO Public Class ouvrirplaylist Private Sub ouvrirplaylist_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) ComboBox1.BackColor = Color.FromArgb(64, 64, 64) Label1.BackColor = Color.FromArgb(64, 64, 64) Label1.ForeColor = Color.White ComboBox1.ForeColor = Color.White ElseIf lines1a(0) = 3 Then Me.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) ComboBox1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) Label1.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) End If ComboBox1.Items.Clear() For Each fichier As String In IO.Directory.GetDirectories(dosplaylist) Dim info As New IO.DirectoryInfo(fichier) ComboBox1.Items.Add(info.Name) Next End Sub Private Sub ComboBox1_SelectedValueChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedValueChanged ListBox1.Items.Clear() For Each fichier As String In IO.Directory.GetFiles(dosplaylist & ComboBox1.SelectedItem) Dim info As New IO.FileInfo(fichier) ListBox1.Items.Add(info.Name) Next If ListBox1.Items.Count = 0 Then MsgBox("Aucune musique trouvez dans: " & ComboBox1.SelectedItem, MsgBoxStyle.Critical) Else Dim lines3() As String = File.ReadAllLines(notification) If lines3(0) = 1 Then ouvrirfr() ElseIf lines3(0) = 0 Then ouvrirnfr() End If End If End Sub Sub ouvrirfr() Dim sw4 As New StreamWriter(historique) Form12.ListBox1.Items.Clear() Form12.TextBox1.Text = "lecteur média\playlist\" & ComboBox1.SelectedItem Form12.mp3s = IO.Directory.GetFiles(dosplaylist & ComboBox1.SelectedItem, "*.mp3") Dim info As IO.FileInfo For Each mp3 As String In Form12.mp3s info = New IO.FileInfo(mp3) Form12.ListBox1.Items.Add(info.Name) Form12.index = 0 Form12.AxWindowsMediaPlayer1.URL = Form12.mp3s(0) Form12.TextBox2.Text = Form12.mp3s(0) Form12.Text = "Playlist" & ": " & Form12.AxWindowsMediaPlayer1.currentMedia.name Form1.ListBox1.Items.Add(info.Name & " : " & Today & " : " & TimeOfDay) For Each item In Form1.ListBox1.Items Next sw4.Close() Form12.PictureBox4.Hide() Form12.PictureBox3.Show() Form12.PictureBox7.Show() Form12.PictureBox8.Show() Form12.PauseToolStripMenuItem.Enabled = True Form12.PlayToolStripMenuItem.Enabled = False Form12.AllerToolStripMenuItem.Enabled = True Form12.VitesseToolStripMenuItem.Enabled = True Form12.StopToolStripMenuItem.Enabled = True Form12.ListBox1.SetSelected(0, True) Next Form1.NotifyIcon1.BalloonTipTitle = "lecteur média" Form1.NotifyIcon1.BalloonTipText = "vous écouter" & ": " & Form12.AxWindowsMediaPlayer1.currentMedia.name Form1.NotifyIcon1.ShowBalloonTip(1) Form12.Timer1.Start() Close() End Sub Sub ouvrirnfr() Dim sw4 As New StreamWriter(historique) Form12.ListBox1.Items.Clear() Form12.TextBox1.Text = "lecteur média\playlist\" & ComboBox1.SelectedItem Form12.mp3s = IO.Directory.GetFiles(dosplaylist & ComboBox1.SelectedItem, "*.mp3") Dim info As IO.FileInfo For Each mp3 As String In Form12.mp3s info = New IO.FileInfo(mp3) Form12.ListBox1.Items.Add(info.Name) Form12.index = 0 Form12.AxWindowsMediaPlayer1.URL = Form12.mp3s(0) Form12.TextBox2.Text = Form12.mp3s(0) Form12.Text = "Playlist" & ": " & Form12.AxWindowsMediaPlayer1.currentMedia.name Form1.ListBox1.Items.Add(info.Name & " : " & Today & " : " & TimeOfDay) For Each item In Form1.ListBox1.Items Next sw4.Close() Form12.PictureBox4.Hide() Form12.PictureBox3.Show() Form12.PictureBox7.Show() Form12.PictureBox8.Show() Form12.PauseToolStripMenuItem.Enabled = True Form12.PlayToolStripMenuItem.Enabled = False Form12.StopToolStripMenuItem.Enabled = True Form12.AllerToolStripMenuItem.Enabled = True Form12.VitesseToolStripMenuItem.Enabled = True Form12.ListBox1.SetSelected(0, True) Form12.Timer1.Start() Next End Sub End Class