224 lines
8.7 KiB
VB.net
224 lines
8.7 KiB
VB.net
Imports System.ComponentModel
|
||
Imports System.IO
|
||
Public Class Form91
|
||
Private Sub Form91_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
|
||
Button2.BackColor = Color.FromArgb(64, 64, 64)
|
||
Button2.ForeColor = Color.White
|
||
Button3.BackColor = Color.FromArgb(64, 64, 64)
|
||
Button3.ForeColor = Color.White
|
||
Button4.BackColor = Color.FromArgb(64, 64, 64)
|
||
Button4.ForeColor = Color.White
|
||
ListBox1.BackColor = Color.FromArgb(64, 64, 64)
|
||
ListBox1.ForeColor = Color.White
|
||
ElseIf lines1a(0) = 3 Then
|
||
Else
|
||
|
||
End If
|
||
|
||
For Each fichier As String In IO.Directory.GetDirectories(Favoris1)
|
||
Dim info As New IO.FileInfo(fichier)
|
||
ListBox1.Items.Add(info.Name)
|
||
Next
|
||
Button1.Enabled = False
|
||
Button2.Enabled = False
|
||
End Sub
|
||
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
||
ListBox1.ContextMenuStrip.Enabled = False
|
||
Button1.Enabled = False
|
||
Button2.Enabled = False
|
||
Button4.Enabled = False
|
||
Dim lines3() As String = File.ReadAllLines(notification)
|
||
If lines3(0) = 0 Then
|
||
nonotif()
|
||
ElseIf lines3(0) = 1 Then
|
||
lang()
|
||
End If
|
||
End Sub
|
||
|
||
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
|
||
ListBox1.ContextMenuStrip.Enabled = False
|
||
Button1.Enabled = False
|
||
Button2.Enabled = False
|
||
If ListBox1.Items.Count = 0 Then
|
||
MsgBox("Aucun Favori a été trouvez", MsgBoxStyle.Exclamation)
|
||
Else
|
||
Dim t1 = ListBox1.SelectedItem
|
||
Dim t2 = Favoris1 & t1 & "\flux.txt"
|
||
Dim t3 = Favoris1 & t1
|
||
File.Delete(t2)
|
||
Directory.Delete(t3)
|
||
|
||
MsgBox("Le Favori: " & ListBox1.SelectedItem & " a bien été supprimer", MsgBoxStyle.Information)
|
||
|
||
ListBox1.Items.Clear()
|
||
|
||
For Each fichier As String In IO.Directory.GetDirectories(Favoris1)
|
||
Dim info As New IO.FileInfo(fichier)
|
||
ListBox1.Items.Add(info.Name)
|
||
Next
|
||
End If
|
||
End Sub
|
||
|
||
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
|
||
If ListBox1.Items.Count = 0 Then
|
||
MsgBox("Aucun Favori a été trouvez", MsgBoxStyle.Exclamation)
|
||
Else
|
||
Dim t1 = ListBox1.SelectedItem
|
||
Dim t2 = Favoris1 & t1 & "\flux.txt"
|
||
Dim t3 = Favoris1 & t1
|
||
File.Delete(t2)
|
||
Directory.Delete(t3)
|
||
|
||
MsgBox("Le favori: " & ListBox1.SelectedItem & " a bien été supprimer", MsgBoxStyle.Information)
|
||
|
||
ListBox1.Items.Clear()
|
||
|
||
For Each fichier As String In IO.Directory.GetDirectories(Favoris1)
|
||
Dim info As New IO.FileInfo(fichier)
|
||
ListBox1.Items.Add(info.Name)
|
||
Next
|
||
End If
|
||
End Sub
|
||
|
||
Private Sub LireToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles LireToolStripMenuItem.Click
|
||
ListBox1.ContextMenuStrip.Enabled = False
|
||
Dim lines3() As String = File.ReadAllLines(notification)
|
||
If lines3(0) = 0 Then
|
||
nonotif()
|
||
ElseIf lines3(0) = 1 Then
|
||
lang()
|
||
End If
|
||
End Sub
|
||
|
||
Private Sub SupprimerToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SupprimerToolStripMenuItem.Click
|
||
ListBox1.ContextMenuStrip.Enabled = False
|
||
If ListBox1.Items.Count = 0 Then
|
||
MsgBox("Aucun Favori a été trouvez", MsgBoxStyle.Exclamation)
|
||
Else
|
||
Dim t1 = ListBox1.SelectedItem
|
||
Dim t2 = Favoris1 & t1 & "\flux.txt"
|
||
Dim t3 = Favoris1 & t1
|
||
File.Delete(t2)
|
||
Directory.Delete(t3)
|
||
|
||
MsgBox("Le favoris: " & ListBox1.SelectedItem & " a bien été supprimer", MsgBoxStyle.Information)
|
||
|
||
ListBox1.Items.Clear()
|
||
|
||
For Each fichier As String In IO.Directory.GetDirectories(Favoris1)
|
||
Dim info As New IO.FileInfo(fichier)
|
||
ListBox1.Items.Add(info.Name)
|
||
Next
|
||
End If
|
||
|
||
End Sub
|
||
|
||
Private Sub ToutSupprimerToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ToutSupprimerToolStripMenuItem.Click
|
||
Dim sw4 As New StreamWriter(Favoris1)
|
||
ListBox1.Items.Clear()
|
||
For Each item In ListBox1.Items
|
||
sw4.WriteLine(item)
|
||
Next
|
||
sw4.Close()
|
||
End Sub
|
||
|
||
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
|
||
Close()
|
||
End Sub
|
||
Sub nonotif()
|
||
Dim t1 = ListBox1.SelectedItem
|
||
Dim t2 = Favoris1 & t1 & "\flux.txt"
|
||
Dim lines1() As String = File.ReadAllLines(t2)
|
||
TextBox1.Text = lines1(0)
|
||
If File.Exists(TextBox1.Text) = True Then
|
||
If TextBox1.Text.EndsWith(".mp3") Then
|
||
Form8.AxWindowsMediaPlayer1.URL = lines1(0)
|
||
Dim sw4 As New StreamWriter(historique)
|
||
Form8.TextBox1.Text = Form8.AxWindowsMediaPlayer1.URL
|
||
Form1.ListBox1.Items.Add(Form8.AxWindowsMediaPlayer1.currentMedia.name & " : " & Today & " : " & TimeOfDay)
|
||
|
||
For Each item In Form1.ListBox1.Items
|
||
sw4.WriteLine(item)
|
||
Next
|
||
sw4.Close()
|
||
Form8.PictureBox5.Hide()
|
||
Form8.PictureBox2.Show()
|
||
Form8.PictureBox3.Hide()
|
||
Form8.PictureBox4.Show()
|
||
Form8.VitesseToolStripMenuItem.Enabled = False
|
||
Form8.AllerToolStripMenuItem.Enabled = False
|
||
Form8.PauseToolStripMenuItem.Enabled = True
|
||
Form8.StopToolStripMenuItem.Enabled = True
|
||
Form8.Text = "lecteur média" & ": " & Form8.AxWindowsMediaPlayer1.currentMedia.name
|
||
|
||
Else
|
||
MsgBox("Vous ne pouvez qu’ouvrir des Favoris musicaux", MsgBoxStyle.Information)
|
||
Exit Sub
|
||
End If
|
||
Else
|
||
MsgBox("Le Favori sélectionné: " & ListBox1.SelectedItem & " a été déplacer ou supprimer", MsgBoxStyle.Information)
|
||
Exit Sub
|
||
End If
|
||
|
||
Close()
|
||
End Sub
|
||
Sub lang()
|
||
fr()
|
||
End Sub
|
||
Sub fr()
|
||
Dim t1 = ListBox1.SelectedItem
|
||
Dim t2 = Favoris1 & t1 & "\flux.txt"
|
||
Dim lines1() As String = File.ReadAllLines(t2)
|
||
TextBox1.Text = lines1(0)
|
||
If File.Exists(TextBox1.Text) = True Then
|
||
If TextBox1.Text.EndsWith(".mp3") Then
|
||
Form8.AxWindowsMediaPlayer1.URL = lines1(0)
|
||
Form8.AjoutterAuFavorisToolStripMenuItem.Enabled = True
|
||
Dim sw4 As New StreamWriter(historique)
|
||
Form8.TextBox1.Text = Form8.AxWindowsMediaPlayer1.URL
|
||
Form1.ListBox1.Items.Add(Form8.AxWindowsMediaPlayer1.currentMedia.name & " : " & Today & " : " & TimeOfDay)
|
||
|
||
For Each item In Form1.ListBox1.Items
|
||
sw4.WriteLine(item)
|
||
Next
|
||
sw4.Close()
|
||
Form8.PictureBox2.Show()
|
||
Form8.PictureBox3.Hide()
|
||
Form8.PictureBox4.Show()
|
||
Form8.VitesseToolStripMenuItem.Enabled = True
|
||
Form8.AllerToolStripMenuItem.Enabled = True
|
||
Form8.PauseToolStripMenuItem.Enabled = True
|
||
Form8.StopToolStripMenuItem.Enabled = True
|
||
Form1.NotifyIcon1.BalloonTipTitle = "lecteur média"
|
||
Form1.NotifyIcon1.BalloonTipText = "vous écouter:" & " " & Form8.AxWindowsMediaPlayer1.currentMedia.name
|
||
Form1.NotifyIcon1.ShowBalloonTip(1)
|
||
Form8.Text = "lecteur média" & ": " & Form8.AxWindowsMediaPlayer1.currentMedia.name
|
||
Else
|
||
MsgBox("Vous ne pouvez qu’ouvrir des Favoris musicaux", MsgBoxStyle.Information)
|
||
Exit Sub
|
||
|
||
End If
|
||
Else
|
||
MsgBox("Le Favori sélectionné: " & ListBox1.SelectedItem & " a été déplacer ou supprimer", MsgBoxStyle.Information)
|
||
Exit Sub
|
||
End If
|
||
Close()
|
||
End Sub
|
||
Private Sub ListBox1_SelectedValueChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedValueChanged
|
||
ListBox1.ContextMenuStrip = ContextMenuStrip1
|
||
ListBox1.ContextMenuStrip.Enabled = True
|
||
Button1.Enabled = True
|
||
Button2.Enabled = True
|
||
Button4.Enabled = True
|
||
End Sub
|
||
|
||
Private Sub Form91_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
|
||
ListBox1.Items.Clear()
|
||
End Sub
|
||
End Class |