Imports System.ComponentModel Imports System.IO Imports System.Net Imports WMPLib Imports System.Math Public Class formséries Public nom As String = "" Public urllike As String = "" Public url As String = "" Public dl As Integer = 0 Private Sub formséries_Load(sender As Object, e As EventArgs) Handles MyBase.Load Dim lines1a() As String = File.ReadAllLines(théme) If lines1a(0) = 2 Then CheckBox1.ForeColor = Color.White Me.BackColor = Color.FromArgb(64, 64, 64) ComboBox1.BackColor = Color.FromArgb(64, 64, 64) ComboBox2.BackColor = Color.FromArgb(64, 64, 64) Button1.BackColor = Color.FromArgb(64, 64, 64) ComboBox1.ForeColor = Color.White ComboBox2.ForeColor = Color.White Label10.ForeColor = Color.White Label9.ForeColor = Color.White Label1.ForeColor = Color.White Label2.ForeColor = Color.White Label3.ForeColor = Color.White Label4.ForeColor = Color.White Button1.ForeColor = Color.White CircularProgressBar1.ForeColor = Color.White LinkLabel1.LinkColor = Color.White LinkLabel1.ActiveLinkColor = Color.White ElseIf lines1a(0) = 3 Then LinkLabel1.LinkColor = Form1.ForeColor LinkLabel1.ActiveLinkColor = Form1.ForeColor PictureBox5.Image = Form1.PictureBox12.Image PictureBox4.Image = Form1.PictureBox11.Image PictureBox2.Image = Form1.PictureBox10.Image CheckBox1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) Me.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) ComboBox1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) ComboBox2.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) Button1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) ComboBox1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) ComboBox2.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) Label10.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) Label9.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) Label1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) Label2.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) Label3.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) Label4.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) Button1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) CircularProgressBar1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) End If Text = nom Label2.Text = nom If Directory.Exists(dossérie & "/" & nom & "/") = True Then Else Directory.CreateDirectory(dossérie & "/" & nom & "/") End If ComboBox1.Items.Clear() Dim fwr As FtpWebRequest fwr = FtpWebRequest.Create(urllike & "/saison/") fwr.Credentials = New NetworkCredential("yoannsafe", passftp) fwr.Method = WebRequestMethods.Ftp.ListDirectory Dim sr As New StreamReader(fwr.GetResponse().GetResponseStream()) Dim str As String = sr.ReadLine() While Not str Is Nothing ComboBox1.Items.Add(str) str = sr.ReadLine() End While sr.Close() ComboBox1.SelectedItem = "Saison 1" ComboBox2.Items.Clear() Dim fwr2 As FtpWebRequest fwr2 = FtpWebRequest.Create(urllike & "/saison/" & ComboBox1.SelectedItem & "/") fwr2.Credentials = New NetworkCredential("yoannsafe", passftp) fwr2.Method = WebRequestMethods.Ftp.ListDirectory Dim sr2 As New StreamReader(fwr2.GetResponse().GetResponseStream()) Dim str2 As String = sr2.ReadLine() ComboBox2.Items.Add("Tout les épisodes") While Not str2 Is Nothing ComboBox2.Items.Add(str2) str2 = sr2.ReadLine() End While ComboBox2.Items.Remove("ep.txt") ComboBox2.Items.Remove(ComboBox1.SelectedItem & ".zip") ComboBox2.SelectedItem = "Tout les épisodes" If Directory.Exists(dossérie & "/" & nom & "/" & ComboBox1.SelectedItem) = True Then PictureBox2.Hide() PictureBox3.Show() CircularProgressBar1.Hide() Else PictureBox2.Show() PictureBox3.Hide() CircularProgressBar1.Hide() End If If File.Exists(dossérie & "/" & nom & "/like.txt") = True Then Else Dim sw1 As New StreamWriter(dossérie & "/" & nom & "/like.txt") sw1.WriteLine(0) sw1.Close() End If Dim lines3() As String = File.ReadAllLines(dossérie & "/" & nom & "/like.txt") If lines3(0) = 1 Then PictureBox4.Show() PictureBox5.Hide() Else PictureBox4.Hide() PictureBox5.Show() End If ComboBox2.Items.Remove("Tout les épisodes") Dim ep = ComboBox2.Items.Count ComboBox2.Items.Clear() Dim episode789456 As Integer = 1 For x = 1 To ep ComboBox2.Items.Add("Épisode " & episode789456) episode789456 = episode789456 + 1 Next ComboBox2.Items.Add("Tout les épisodes") ComboBox2.SelectedItem = "Tout les épisodes" Dim ep2 = ComboBox1.Items.Count ComboBox1.Items.Clear() Dim episode7894561 As Integer = 1 For x = 1 To ep2 ComboBox1.Items.Add("Saison " & episode7894561) episode7894561 = episode7894561 + 1 Next ComboBox1.SelectedItem = "Saison 1" Timer1.Start() Timer4.Start() End Sub Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick If WindowState = 1 Then Form1.Visible = False séries.Visible = False Else Form1.Visible = True séries.Visible = True End If Dim maj As New WebClient Dim vri As String = maj.DownloadString(url & "/like.txt") Label10.Text = vri End Sub Private Sub ComboBox1_SelectedValueChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedValueChanged ComboBox2.Items.Clear() Dim fwr2 As FtpWebRequest fwr2 = FtpWebRequest.Create(urllike & "/saison/" & ComboBox1.SelectedItem & "/") fwr2.Credentials = New NetworkCredential("yoannsafe", passftp) fwr2.Method = WebRequestMethods.Ftp.ListDirectory Dim sr2 As New StreamReader(fwr2.GetResponse().GetResponseStream()) Dim str2 As String = sr2.ReadLine() ComboBox2.Items.Add("Tout les épisodes") While Not str2 Is Nothing ComboBox2.Items.Add(str2) str2 = sr2.ReadLine() End While ComboBox2.Items.Remove("ep.txt") ComboBox2.Items.Remove(ComboBox1.SelectedItem & ".zip") ComboBox2.SelectedItem = "Tout les épisodes" If Directory.Exists(dossérie & "/" & nom & "/" & ComboBox1.SelectedItem) = True Then PictureBox2.Hide() PictureBox3.Show() CircularProgressBar1.Hide() Else PictureBox2.Show() PictureBox3.Hide() CircularProgressBar1.Hide() End If Button1.Text = "Lire " & nom & " " & ComboBox1.SelectedItem & " " & ComboBox2.SelectedItem ComboBox2.Items.Remove("Tout les épisodes") Dim ep = ComboBox2.Items.Count ComboBox2.Items.Clear() Dim episode789456 As Integer = 1 For x = 1 To ep ComboBox2.Items.Add("Épisode " & episode789456) episode789456 = episode789456 + 1 Next ComboBox2.Items.Add("Tout les épisodes") ComboBox2.SelectedItem = "Tout les épisodes" End Sub Private Sub ComboBox2_SelectedValueChanged(sender As Object, e As EventArgs) Handles ComboBox2.SelectedValueChanged If File.Exists(dossérie & "\" & nom & "\" & ComboBox1.SelectedItem & "\" & nom & " " & ComboBox1.SelectedItem & " " & ComboBox2.SelectedItem & ".m4v") = True Then PictureBox3.Show() PictureBox2.Hide() ElseIf ComboBox2.SelectedItem = "Tout les épisodes" Then Dim nbeps As Integer = 0 If Directory.Exists(dossérie & "\" & nom & "\" & ComboBox1.SelectedItem & "\") = True Then For Each fichier As String In IO.Directory.GetFiles(dossérie & "\" & nom & "\" & ComboBox1.SelectedItem & "\") nbeps = nbeps + 1 Next If ComboBox2.Items.Count - 1 = nbeps Then PictureBox3.Show() PictureBox2.Hide() Else PictureBox2.Show() PictureBox3.Hide() End If Else PictureBox2.Show() PictureBox3.Hide() End If Else PictureBox2.Show() PictureBox3.Hide() End If Button1.Text = "Lire " & nom & " " & ComboBox1.SelectedItem & " " & ComboBox2.SelectedItem End Sub Public Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim lines2() As String = File.ReadAllLines(notification) Form1.AxWindowsMediaPlayer1.currentPlaylist.clear() Form1.PictureBox1.Hide() Form1.Timer25.Stop() If lines2(0) = 1 Then If ComboBox2.SelectedItem = "Tout les épisodes" Then Form1.series1ep = 0 Form1.NotifyIcon1.BalloonTipTitle = "lecteur média" Form1.NotifyIcon1.BalloonTipText = "vous regarder: " & nom & " " & ComboBox1.SelectedItem Form1.NotifyIcon1.ShowBalloonTip(1) Form1.GunaAdvenceButton1.Show() Form1.GunaAdvenceButton2.Show() Form1.AxWindowsMediaPlayer1.URL = url & "/saison/" & ComboBox1.SelectedItem & "/" & "Épisode 1/" & nom & " " & ComboBox1.SelectedItem & " " & "Épisode 1.m4v" Dim maj1 As New WebClient Dim vri1 As String = maj1.DownloadString(url & "/saison/" & ComboBox1.SelectedItem & "/ep.txt") vri1 = vri1 - 1 Dim ep As Integer = vri1 Dim isod As Integer = 2 For x = 1 To ep ad = Form1.AxWindowsMediaPlayer1.newMedia(url & "/saison/" & ComboBox1.SelectedItem & "/" & "Épisode " & isod & "/" & nom & " " & ComboBox1.SelectedItem & " " & "Épisode " & isod & ".m4v") Form1.AxWindowsMediaPlayer1.currentPlaylist.appendItem(ad) isod = isod + 1 Next Form1.PictureBox2.Hide() Form1.PictureBox7.Hide() Form1.PictureBox1.Hide() Form1.PictureBox4.Show() Form1.VitesseToolStripMenuItem.Enabled = True Form1.AllaiAToolStripMenuItem.Enabled = True Form1.PictureBox5.Enabled = True Form1.PictureBox6.Enabled = True Form1.PictureBox7.Enabled = True Form1.PauseToolStripMenuItem.Enabled = True Form1.StopToolStripMenuItem.Enabled = True Form1.PleinToolStripMenuItem.Enabled = True Button1.Enabled = True Form1.PictureBox1.Hide() Form1.TextBox1.Text = nom & " série" ComboBox2.Items.Remove("Tout les épisodes") Form1.seriesencourssaisonnbep = ComboBox2.Items.Count ComboBox2.Items.Add("Tout les épisodes") Form1.seriesencourssaison = ComboBox1.SelectedIndex + 1 Form1.seriesencours = nom Form1.Timer24.Start() Close() séries.Close() Else Form1.TextBox1.Text = nom & " série" Form1.NotifyIcon1.BalloonTipTitle = "lecteur média" Form1.NotifyIcon1.BalloonTipText = "vous regarder: " & nom & " " & ComboBox1.SelectedItem & " " & ComboBox2.SelectedItem Form1.PictureBox2.Hide() Form1.PictureBox7.Hide() Form1.PictureBox1.Hide() Form1.PictureBox4.Show() Form1.VitesseToolStripMenuItem.Enabled = True Form1.AllaiAToolStripMenuItem.Enabled = True Form1.PictureBox5.Enabled = True Form1.PictureBox6.Enabled = True Form1.PictureBox7.Enabled = True Form1.PauseToolStripMenuItem.Enabled = True Form1.StopToolStripMenuItem.Enabled = True Form1.PleinToolStripMenuItem.Enabled = True Button1.Enabled = True Form1.AxWindowsMediaPlayer1.URL = url & "/saison/" & ComboBox1.SelectedItem & "/" & ComboBox2.SelectedItem & "/" & nom & " " & ComboBox1.SelectedItem & " " & ComboBox2.SelectedItem & ".m4v" ComboBox2.Items.Remove("Tout les épisodes") Form1.seriesencourssaisonnbep = ComboBox2.Items.Count ComboBox2.Items.Add("Tout les épisodes") Form1.seriesencourssaison = ComboBox1.SelectedIndex + 1 Form1.seriesencours = nom Form1.series1ep = 1 Form1.Timer24.Start() Close() séries.Close() End If Else If ComboBox2.SelectedItem = "Tout les épisodes" Then Form1.series1ep = 0 Form1.NotifyIcon1.BalloonTipTitle = "lecteur média" Form1.NotifyIcon1.BalloonTipText = "vous regarder: " & nom & " " & ComboBox1.SelectedItem Form1.NotifyIcon1.ShowBalloonTip(1) Form1.GunaAdvenceButton1.Show() Form1.GunaAdvenceButton2.Show() Form1.AxWindowsMediaPlayer1.URL = url & "/saison/" & ComboBox1.SelectedItem & "/" & "Épisode 1/" & nom & " " & ComboBox1.SelectedItem & " " & "Épisode 1.m4v" Dim maj1 As New WebClient Dim vri1 As String = maj1.DownloadString(url & "/saison/" & ComboBox1.SelectedItem & "/ep.txt") vri1 = vri1 - 1 Dim ep As Integer = vri1 Dim isod As Integer = 2 For x = 1 To ep ad = Form1.AxWindowsMediaPlayer1.newMedia(url & "/saison/" & ComboBox1.SelectedItem & "/" & "Épisode " & isod & "/" & nom & " " & ComboBox1.SelectedItem & " " & "Épisode " & isod & ".m4v") Form1.AxWindowsMediaPlayer1.currentPlaylist.appendItem(ad) isod = isod + 1 Next Form1.PictureBox2.Hide() Form1.PictureBox7.Hide() Form1.PictureBox1.Hide() Form1.PictureBox4.Show() Form1.VitesseToolStripMenuItem.Enabled = True Form1.AllaiAToolStripMenuItem.Enabled = True Form1.PictureBox5.Enabled = True Form1.PictureBox6.Enabled = True Form1.PictureBox7.Enabled = True Form1.PauseToolStripMenuItem.Enabled = True Form1.StopToolStripMenuItem.Enabled = True Form1.PleinToolStripMenuItem.Enabled = True Button1.Enabled = True Form1.PictureBox1.Hide() ComboBox2.Items.Remove("Tout les épisodes") Form1.seriesencourssaisonnbep = ComboBox2.Items.Count ComboBox2.Items.Add("Tout les épisodes") Form1.seriesencourssaison = ComboBox1.SelectedIndex + 1 Form1.seriesencours = nom Form1.Timer24.Start() Close() séries.Close() Else Form1.series1ep = 1 Form1.TextBox1.Text = nom & " série" Form1.NotifyIcon1.BalloonTipTitle = "lecteur média" Form1.NotifyIcon1.BalloonTipText = "vous regarder: " & nom & " " & ComboBox1.SelectedItem & " " & ComboBox2.SelectedItem Form1.PictureBox2.Hide() Form1.PictureBox7.Hide() Form1.PictureBox1.Hide() Form1.PictureBox4.Show() Form1.VitesseToolStripMenuItem.Enabled = True Form1.AllaiAToolStripMenuItem.Enabled = True Form1.PictureBox5.Enabled = True Form1.PictureBox6.Enabled = True Form1.PictureBox7.Enabled = True Form1.PauseToolStripMenuItem.Enabled = True Form1.StopToolStripMenuItem.Enabled = True Form1.PleinToolStripMenuItem.Enabled = True Button1.Enabled = True Form1.AxWindowsMediaPlayer1.URL = url & "/saison/" & ComboBox1.SelectedItem & "/" & ComboBox2.SelectedItem & "/" & nom & " " & ComboBox1.SelectedItem & " " & ComboBox2.SelectedItem & ".m4v" ComboBox2.Items.Remove("Tout les épisodes") Form1.seriesencourssaisonnbep = ComboBox2.Items.Count ComboBox2.Items.Add("Tout les épisodes") Form1.seriesencourssaison = ComboBox1.SelectedIndex + 1 Form1.seriesencours = nom Form1.Timer24.Start() Close() séries.Close() End If End If End Sub Private Sub formséries_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing If dl = 1 Then e.Cancel = True MsgBox("Merci de patienter la fin du téléchargement de " & nom & " " & ComboBox1.SelectedItem, MsgBoxStyle.Exclamation) ElseIf dl = 2 Then e.Cancel = True MsgBox("Merci de patienter la fin du téléchargement de " & nom & " " & ComboBox1.SelectedItem & " " & ComboBox2.SelectedItem, MsgBoxStyle.Exclamation) Else PictureBox1.Image.Dispose() Timer1.Stop() End If End Sub Dim ad As IWMPMedia Private Sub PictureBox2_Click(sender As Object, e As EventArgs) Handles PictureBox2.Click If ComboBox2.SelectedItem = "Tout les épisodes" Then Dim msg = MsgBox("Voulez-vous vraiment télécharger: " & nom & " " & ComboBox1.SelectedItem & " ?", MsgBoxStyle.YesNo) If msg = MsgBoxResult.Yes Then If Directory.Exists(dossérie & "\" & nom & "\" & ComboBox1.SelectedItem & "\") = True Then For Each fichier As String In IO.Directory.GetFiles(dossérie & "/" & nom & "/" & "\" & ComboBox1.SelectedItem) Dim info As New IO.FileInfo(fichier) File.Delete(dossérie & "/" & nom & "/" & "\" & ComboBox1.SelectedItem & "\" & info.Name) Next Directory.Delete(dossérie & "/" & nom & "/" & "\" & ComboBox1.SelectedItem) Else End If dl = 1 CheckBox1.Show() Form1.Timer6.Stop() ComboBox1.Enabled = False ComboBox2.Enabled = False Button1.Enabled = False téléchargerfr = New WebClient téléchargerfr.DownloadFileTaskAsync(New Uri(url & "/saison/" & ComboBox1.SelectedItem & "/" & ComboBox1.SelectedItem & ".zip"), (dossérie & "/" & nom & "/" & ComboBox1.SelectedItem & ".zip")) CircularProgressBar1.Show() Label9.Show() End If Else Dim msg = MsgBox("Voulez-vous vraiment télécharger: " & nom & " " & ComboBox1.SelectedItem & " " & ComboBox2.SelectedItem & " ?", MsgBoxStyle.YesNo) If msg = MsgBoxResult.Yes Then If Directory.Exists(dossérie & "\" & nom & "\" & ComboBox1.SelectedItem & "\") = True Then Else Directory.CreateDirectory(dossérie & "\" & nom & "\" & ComboBox1.SelectedItem & "\") End If dl = 2 CheckBox1.Show() Form1.Timer6.Stop() ComboBox1.Enabled = False ComboBox2.Enabled = False Button1.Enabled = False téléchargerfr2 = New WebClient téléchargerfr2.DownloadFileTaskAsync(New Uri(url & "/saison/" & ComboBox1.SelectedItem & "/" & ComboBox2.SelectedItem & "/" & nom & " " & ComboBox1.SelectedItem & " " & ComboBox2.SelectedItem & ".m4v"), (dossérie & "\" & nom & "\" & ComboBox1.SelectedItem & "\" & nom & " " & ComboBox1.SelectedItem & " " & ComboBox2.SelectedItem & ".m4v")) CircularProgressBar1.Show() Label9.Show() End If End If End Sub Private Sub téléchargerfr_DownloadProgressChanged(sender As Object, e As DownloadProgressChangedEventArgs) Handles téléchargerfr.DownloadProgressChanged If e.ProgressPercentage = "50" Then CircularProgressBar1.ProgressColor = Color.DodgerBlue CircularProgressBar1.Value = e.ProgressPercentage CircularProgressBar1.Text = e.ProgressPercentage & "%" ElseIf e.ProgressPercentage = "10" Then CircularProgressBar1.Value = e.ProgressPercentage CircularProgressBar1.Text = e.ProgressPercentage & "%" CircularProgressBar1.Value = e.ProgressPercentage CircularProgressBar1.Text = e.ProgressPercentage & "%" ElseIf e.ProgressPercentage = "30" Then CircularProgressBar1.Value = e.ProgressPercentage CircularProgressBar1.Text = e.ProgressPercentage & "%" CircularProgressBar1.Value = e.ProgressPercentage CircularProgressBar1.Text = e.ProgressPercentage & "%" ElseIf e.ProgressPercentage = "70" Then CircularProgressBar1.Value = e.ProgressPercentage CircularProgressBar1.Text = e.ProgressPercentage & "%" CircularProgressBar1.Value = e.ProgressPercentage CircularProgressBar1.Text = e.ProgressPercentage & "%" ElseIf e.ProgressPercentage = " 90" Then CircularProgressBar1.Value = e.ProgressPercentage CircularProgressBar1.Text = e.ProgressPercentage & "%" CircularProgressBar1.Value = e.ProgressPercentage CircularProgressBar1.Text = e.ProgressPercentage & "%" ElseIf e.ProgressPercentage = "100" Then CircularProgressBar1.ProgressColor = Color.Green CircularProgressBar1.Value = e.ProgressPercentage CircularProgressBar1.Text = e.ProgressPercentage & "%" ElseIf e.ProgressPercentage = "0" Then CircularProgressBar1.ProgressColor = Color.Red CircularProgressBar1.Value = e.ProgressPercentage CircularProgressBar1.Text = e.ProgressPercentage & "%" End If CircularProgressBar1.Value = e.ProgressPercentage CircularProgressBar1.Text = e.ProgressPercentage & "%" Dim disctédossier = func_RoundTaille(e.BytesReceived) Dim disctédossier2 = func_RoundTaille(e.TotalBytesToReceive) Label9.Text = disctédossier & " / " & disctédossier2 Me.Text = nom & ": " & e.ProgressPercentage & "%: " & disctédossier & " / " & disctédossier2 CircularProgressBar1.Value = e.ProgressPercentage CircularProgressBar1.Text = e.ProgressPercentage & "%" End Sub Private Sub téléchargerfr_DownloadFileCompleted(sender As Object, e As AsyncCompletedEventArgs) Handles téléchargerfr.DownloadFileCompleted Form190.ShowDialog() End Sub Dim WithEvents téléchargerfr As WebClient Dim WithEvents téléchargerfr2 As WebClient Private Sub PictureBox3_Click(sender As Object, e As EventArgs) Handles PictureBox3.Click If ComboBox2.SelectedItem = "Tout les épisodes" Then For Each fichier As String In IO.Directory.GetFiles(dossérie & "/" & nom & "/" & "\" & ComboBox1.SelectedItem) Dim info As New IO.FileInfo(fichier) File.Delete(dossérie & "/" & nom & "/" & "\" & ComboBox1.SelectedItem & "\" & info.Name) Next Directory.Delete(dossérie & "/" & nom & "/" & "\" & ComboBox1.SelectedItem) PictureBox3.Hide() PictureBox2.Show() Else File.Delete(dossérie & "\" & nom & "\" & ComboBox1.SelectedItem & "\" & nom & " " & ComboBox1.SelectedItem & " " & ComboBox2.SelectedItem & ".m4v") Dim nombredefichier As Integer = 0 For Each fichier As String In IO.Directory.GetFiles(dossérie & "\" & nom & "\" & ComboBox1.SelectedItem & "\") Dim info As New IO.FileInfo(fichier) nombredefichier = nombredefichier + 1 Next If nombredefichier = 0 Then Directory.Delete(dossérie & "/" & nom & "/" & "\" & ComboBox1.SelectedItem) End If PictureBox3.Hide() PictureBox2.Show() End If End Sub Private Sub PictureBox5_Click(sender As Object, e As EventArgs) Handles PictureBox5.Click Dim like1 As New WebClient Dim like3 As New WebClient Try like1.DownloadFile(url & "/like.txt", like2 & "like.txt") Catch ex As Exception MsgBox("Impossible de se connecter au serveur", MsgBoxStyle.Information) Exit Sub End Try Dim t1 = like2 & "\like.txt" Dim sr As New StreamReader(t1) While (sr.Peek >= 0) Label11.Text = sr.ReadLine End While sr.Close() Label11.Text = Label11.Text + 1 Dim sw1 As New StreamWriter(t1) sw1.WriteLine(Label11.Text) sw1.Close() Try My.Computer.Network.UploadFile(t1, urllike & "/like.txt") Catch ex As Exception Timer2.Start() File.Delete(t1) Exit Sub End Try File.Delete(t1) Dim sw4 As New StreamWriter(dossérie & "/" & nom & "/like.txt") sw4.WriteLine(1) sw4.Close() PictureBox4.Show() PictureBox5.Hide() End Sub Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick Timer2.Stop() Dim t1 = like2 & "\like.txt" Try My.Computer.Network.UploadFile(t1, urllike & "/like.txt") Catch ex As Exception Timer2.Start() File.Delete(t1) Exit Sub End Try File.Delete(t1) Dim sw4 As New StreamWriter(dossérie & "/" & nom & "/like.txt") sw4.WriteLine(1) sw4.Close() PictureBox4.Show() PictureBox5.Hide() End Sub Private Sub PictureBox4_Click(sender As Object, e As EventArgs) Handles PictureBox4.Click Dim like1 As New WebClient Dim like3 As New WebClient Try like1.DownloadFile(url & "/like.txt", like2 & "like.txt") Catch ex As Exception MsgBox("Impossible de se connecter au serveur", MsgBoxStyle.Information) Exit Sub End Try Dim t1 = like2 & "\like.txt" Dim sr As New StreamReader(t1) While (sr.Peek >= 0) Label11.Text = sr.ReadLine End While sr.Close() Label11.Text = Label11.Text - 1 Dim sw1 As New StreamWriter(t1) sw1.WriteLine(Label11.Text) sw1.Close() Try My.Computer.Network.UploadFile(t1, urllike & "/like.txt") Catch ex As Exception Timer3.Start() File.Delete(t1) Exit Sub End Try File.Delete(t1) Dim sw4 As New StreamWriter(dossérie & "/" & nom & "/like.txt") sw4.WriteLine(0) sw4.Close() PictureBox4.Hide() PictureBox5.Show() End Sub Private Sub Timer3_Tick(sender As Object, e As EventArgs) Handles Timer3.Tick Timer3.Stop() Dim t1 = like2 & "\like.txt" Try My.Computer.Network.UploadFile(t1, urllike & "/like.txt") Catch ex As Exception Timer2.Start() File.Delete(t1) Exit Sub End Try File.Delete(t1) Dim sw4 As New StreamWriter(dossérie & "/" & nom & "/like.txt") sw4.WriteLine(0) sw4.Close() PictureBox4.Hide() PictureBox5.Show() End Sub Private Sub Timer4_Tick(sender As Object, e As EventArgs) Handles Timer4.Tick Timer4.Stop() Form1.series1ep = 0 If File.Exists(dossérie & "\" & nom & "\Saison.txt") = False Then Else Dim lines2() As String = File.ReadAllLines(dossérie & "\" & nom & "\épisode.txt") Dim lines1() As String = File.ReadAllLines(dossérie & "\" & nom & "\Saison.txt") If lines2(1) = lines2(3) Then derniersep() Else Dim msg = MsgBox("Voulez-vous reprendre La saison " & lines1(0) & " épisode " & lines2(0) & " a " & lines2(1), MsgBoxStyle.YesNo) If msg = MsgBoxResult.Yes Then ComboBox1.SelectedIndex = lines1(0) - 1 Form1.NotifyIcon1.BalloonTipTitle = "lecteur média" Form1.NotifyIcon1.BalloonTipText = "vous regarder: " & nom & " " & "Saison " & lines1(0) Form1.NotifyIcon1.ShowBalloonTip(1) Form1.GunaAdvenceButton1.Show() Form1.GunaAdvenceButton2.Show() Form1.AxWindowsMediaPlayer1.URL = url & "/saison/" & "Saison " & lines1(0) & "/" & "Épisode 1/" & nom & " " & "Saison " & lines1(0) & " " & "Épisode 1.m4v" Dim maj1 As New WebClient Dim vri1 As String = maj1.DownloadString(url & "/saison/" & "Saison " & lines1(0) & "/ep.txt") vri1 = vri1 - 1 Dim ep As Integer = vri1 Dim isod As Integer = 2 For x = 1 To ep ad = Form1.AxWindowsMediaPlayer1.newMedia(url & "/saison/" & "Saison " & lines1(0) & "/" & "Épisode " & isod & "/" & nom & " " & "Saison " & lines1(0) & " " & "Épisode " & isod & ".m4v") Form1.AxWindowsMediaPlayer1.currentPlaylist.appendItem(ad) isod = isod + 1 Next If lines2(0) = 1 Then Else Dim rer As Integer = lines2(0) For X = 1 To rer - 1 Form1.AxWindowsMediaPlayer1.Ctlcontrols.next() Next End If Form1.AxWindowsMediaPlayer1.Ctlcontrols.currentPosition = lines2(2) Form1.PictureBox2.Hide() Form1.PictureBox7.Hide() Form1.PictureBox1.Hide() Form1.PictureBox4.Show() Form1.VitesseToolStripMenuItem.Enabled = True Form1.AllaiAToolStripMenuItem.Enabled = True Form1.PictureBox5.Enabled = True Form1.PictureBox6.Enabled = True Form1.PictureBox7.Enabled = True Form1.PauseToolStripMenuItem.Enabled = True Form1.StopToolStripMenuItem.Enabled = True Form1.PleinToolStripMenuItem.Enabled = True Button1.Enabled = True Form1.PictureBox1.Hide() Form1.TextBox1.Text = nom & " série" Form1.seriesencours = nom ComboBox2.Items.Remove("Tout les épisodes") Form1.seriesencourssaisonnbep = ComboBox2.Items.Count ComboBox2.Items.Add("Tout les épisodes") Form1.seriesencourssaison = ComboBox1.SelectedIndex + 1 Form1.Timer24.Start() Close() séries.Close() Else ComboBox2.SelectedItem = "Tout les épisodes" End If End If End If End Sub Sub derniersaison() Dim lines2() As String = File.ReadAllLines(dossérie & "\" & nom & "\épisode.txt") Dim lines1() As String = File.ReadAllLines(dossérie & "\" & nom & "\Saison.txt") Dim tr = lines1(0) + 1 Dim tr2 = ComboBox1.Items.Count If tr > tr2 Then Dim msg = MsgBox("Voulez-vous commencer La saison 1", MsgBoxStyle.YesNo) If msg = MsgBoxResult.Yes Then ComboBox1.SelectedIndex = 0 Form1.NotifyIcon1.BalloonTipTitle = "lecteur média" Form1.NotifyIcon1.BalloonTipText = "vous regarder: " & nom & " " & "Saison 1" Form1.NotifyIcon1.ShowBalloonTip(1) Form1.GunaAdvenceButton1.Show() Form1.GunaAdvenceButton2.Show() Form1.AxWindowsMediaPlayer1.URL = url & "/saison/" & "Saison 1/" & "Épisode 1/" & nom & " " & "Saison 1" & " " & "Épisode 1.m4v" Dim maj1 As New WebClient Dim vri1 As String = maj1.DownloadString(url & "/saison/" & "Saison 1/ep.txt") vri1 = vri1 - 1 Dim ep As Integer = vri1 Dim isod As Integer = 2 For x = 1 To ep ad = Form1.AxWindowsMediaPlayer1.newMedia(url & "/saison/" & "Saison 1/" & "Épisode " & isod & "/" & nom & " " & "Saison 1" & " " & "Épisode " & isod & ".m4v") Form1.AxWindowsMediaPlayer1.currentPlaylist.appendItem(ad) isod = isod + 1 Next Form1.PictureBox2.Hide() Form1.PictureBox7.Hide() Form1.PictureBox1.Hide() Form1.PictureBox4.Show() Form1.VitesseToolStripMenuItem.Enabled = True Form1.AllaiAToolStripMenuItem.Enabled = True Form1.PictureBox5.Enabled = True Form1.PictureBox6.Enabled = True Form1.PictureBox7.Enabled = True Form1.PauseToolStripMenuItem.Enabled = True Form1.StopToolStripMenuItem.Enabled = True Form1.PleinToolStripMenuItem.Enabled = True Button1.Enabled = True Form1.PictureBox1.Hide() Form1.TextBox1.Text = nom & " série" Form1.seriesencours = nom ComboBox2.Items.Remove("Tout les épisodes") Form1.seriesencourssaisonnbep = ComboBox2.Items.Count ComboBox2.Items.Add("Tout les épisodes") Form1.seriesencourssaison = ComboBox1.SelectedIndex + 1 Form1.Timer24.Start() Close() séries.Close() Else ComboBox2.SelectedItem = "Tout les épisodes" End If Else Dim msg = MsgBox("Voulez-vous commencer La saison " & lines1(0) + 1, MsgBoxStyle.YesNo) Dim azaz = lines1(0) + 1 If msg = MsgBoxResult.Yes Then ComboBox1.SelectedIndex = azaz - 1 ComboBox2.SelectedIndex = 0 Button1.PerformClick() Else ComboBox2.SelectedItem = "Tout les épisodes" End If End If End Sub Sub derniersep() Dim lines2() As String = File.ReadAllLines(dossérie & "\" & nom & "\épisode.txt") Dim lines1() As String = File.ReadAllLines(dossérie & "\" & nom & "\Saison.txt") ComboBox1.SelectedIndex = lines1(0) - 1 ComboBox2.Items.Remove("Tout les épisodes") If lines2(0) = ComboBox2.Items.Count Then ComboBox2.Items.Add("Tout les épisodes") derniersaison() Else ComboBox2.Items.Add("Tout les épisodes") Dim msg = MsgBox("Voulez-vous reprendre La saison " & lines1(0) & " épisode " & lines2(0) & " a " & lines2(1), MsgBoxStyle.YesNo) If msg = MsgBoxResult.Yes Then ComboBox1.SelectedIndex = lines1(0) - 1 Form1.NotifyIcon1.BalloonTipTitle = "lecteur média" Form1.NotifyIcon1.BalloonTipText = "vous regarder: " & nom & " " & "Saison " & lines1(0) Form1.NotifyIcon1.ShowBalloonTip(1) Form1.GunaAdvenceButton1.Show() Form1.GunaAdvenceButton2.Show() Form1.AxWindowsMediaPlayer1.URL = url & "/saison/" & "Saison " & lines1(0) & "/" & "Épisode 1/" & nom & " " & "Saison " & lines1(0) & " " & "Épisode 1.m4v" Dim maj1 As New WebClient Dim vri1 As String = maj1.DownloadString(url & "/saison/" & "Saison " & lines1(0) & "/ep.txt") vri1 = vri1 - 1 Dim ep As Integer = vri1 Dim isod As Integer = 2 For x = 1 To ep ad = Form1.AxWindowsMediaPlayer1.newMedia(url & "/saison/" & "Saison " & lines1(0) & "/" & "Épisode " & isod & "/" & nom & " " & "Saison " & lines1(0) & " " & "Épisode " & isod & ".m4v") Form1.AxWindowsMediaPlayer1.currentPlaylist.appendItem(ad) isod = isod + 1 Next If lines2(0) = 1 Then Else Dim rer As Integer = lines2(0) For X = 1 To rer - 1 Form1.AxWindowsMediaPlayer1.Ctlcontrols.next() Next End If Form1.AxWindowsMediaPlayer1.Ctlcontrols.currentPosition = lines2(2) Form1.PictureBox2.Hide() Form1.PictureBox7.Hide() Form1.PictureBox1.Hide() Form1.PictureBox4.Show() Form1.VitesseToolStripMenuItem.Enabled = True Form1.AllaiAToolStripMenuItem.Enabled = True Form1.PictureBox5.Enabled = True Form1.PictureBox6.Enabled = True Form1.PictureBox7.Enabled = True Form1.PauseToolStripMenuItem.Enabled = True Form1.StopToolStripMenuItem.Enabled = True Form1.PleinToolStripMenuItem.Enabled = True Button1.Enabled = True Form1.PictureBox1.Hide() Form1.TextBox1.Text = nom & " série" Form1.seriesencours = nom ComboBox2.Items.Remove("Tout les épisodes") Form1.seriesencourssaisonnbep = ComboBox2.Items.Count ComboBox2.Items.Add("Tout les épisodes") Form1.seriesencourssaison = ComboBox1.SelectedIndex + 1 Form1.Text = lecteurnom & ": " & Form1.AxWindowsMediaPlayer1.currentMedia.name Form1.Timer24.Start() Close() séries.Close() Else ComboBox2.SelectedItem = "Tout les épisodes" End If End If End Sub Private Sub téléchargerfr2_DownloadProgressChanged(sender As Object, e As DownloadProgressChangedEventArgs) Handles téléchargerfr2.DownloadProgressChanged If e.ProgressPercentage = "50" Then CircularProgressBar1.ProgressColor = Color.DodgerBlue CircularProgressBar1.Value = e.ProgressPercentage CircularProgressBar1.Text = e.ProgressPercentage & "%" ElseIf e.ProgressPercentage = "10" Then CircularProgressBar1.Value = e.ProgressPercentage CircularProgressBar1.Text = e.ProgressPercentage & "%" CircularProgressBar1.Value = e.ProgressPercentage CircularProgressBar1.Text = e.ProgressPercentage & "%" ElseIf e.ProgressPercentage = "30" Then CircularProgressBar1.Value = e.ProgressPercentage CircularProgressBar1.Text = e.ProgressPercentage & "%" CircularProgressBar1.Value = e.ProgressPercentage CircularProgressBar1.Text = e.ProgressPercentage & "%" ElseIf e.ProgressPercentage = "70" Then CircularProgressBar1.Value = e.ProgressPercentage CircularProgressBar1.Text = e.ProgressPercentage & "%" CircularProgressBar1.Value = e.ProgressPercentage CircularProgressBar1.Text = e.ProgressPercentage & "%" ElseIf e.ProgressPercentage = " 90" Then CircularProgressBar1.Value = e.ProgressPercentage CircularProgressBar1.Text = e.ProgressPercentage & "%" CircularProgressBar1.Value = e.ProgressPercentage CircularProgressBar1.Text = e.ProgressPercentage & "%" ElseIf e.ProgressPercentage = "100" Then CircularProgressBar1.ProgressColor = Color.Green CircularProgressBar1.Value = e.ProgressPercentage CircularProgressBar1.Text = e.ProgressPercentage & "%" ElseIf e.ProgressPercentage = "0" Then CircularProgressBar1.ProgressColor = Color.Red CircularProgressBar1.Value = e.ProgressPercentage CircularProgressBar1.Text = e.ProgressPercentage & "%" End If CircularProgressBar1.Value = e.ProgressPercentage CircularProgressBar1.Text = e.ProgressPercentage & "%" Dim disctédossier = func_RoundTaille(e.BytesReceived) Dim disctédossier2 = func_RoundTaille(e.TotalBytesToReceive) Label9.Text = disctédossier & " / " & disctédossier2 Me.Text = nom & ": " & e.ProgressPercentage & "%: " & disctédossier & " / " & disctédossier2 CircularProgressBar1.Value = e.ProgressPercentage CircularProgressBar1.Text = e.ProgressPercentage & "%" End Sub Private Sub téléchargerfr2_DownloadFileCompleted(sender As Object, e As AsyncCompletedEventArgs) Handles téléchargerfr2.DownloadFileCompleted dl = 0 PictureBox2.Hide() PictureBox3.Show() CircularProgressBar1.Hide() ComboBox1.Enabled = True ComboBox2.Enabled = True Button1.Enabled = True Form1.min = Form1.minmax Form1.Timer6.Start() Label9.Hide() Me.Text = nom If CheckBox1.Checked = True Then CheckBox1.Checked = False CheckBox1.Hide() Form1.Timer6.Start() Form92.ShowDialog() Else Dim lines1() As String = File.ReadAllLines(Form1.settingseries) If lines1(0) = 1 Then Dim son = New System.Media.SoundPlayer(My.Resources.fin_de_téléchargement) son.Play() CheckBox1.Hide() MsgBox("Téléchargement terminer", MsgBoxStyle.Information) Form1.Timer6.Start() ElseIf lines1(0) = 0 Then CheckBox1.Hide() MsgBox("Téléchargement terminer", MsgBoxStyle.Information) Form1.Timer6.Start() Else Form74.startserie = 1 Form74.ShowDialog() End If End If End Sub Public Function func_RoundTaille(ByVal LaTaille As Long) As String Select Case LaTaille Case Is < 1024 Return Round(LaTaille) & " Octets" Case Is < 1048576 Return Round(LaTaille / 2 ^ 10, 3) & " Ko" Case Is < 1073741824 Return Round(LaTaille / 2 ^ 20, 3) & " Mo" Case Else Return Round(LaTaille / 2 ^ 30, 3) & " Go" End Select End Function Private Sub LinkLabel1_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked Try Dim maj As New WebClient Dim vri As String = maj.DownloadString(urllike & "resum.txt") My.Computer.Network.DownloadFile(urllike & "resum.txt", dosparamètres & "/resumtemps.txt") Dim lines1() As String = File.ReadAllLines(dosparamètres & "/resumtemps.txt") File.Delete(dosparamètres & "/resumtemps.txt") MsgBox(lines1(0)) Catch ex As Exception MsgBox("aucun résumé trouvez", MsgBoxStyle.Information) End Try End Sub End Class