548 lines
22 KiB
VB.net
548 lines
22 KiB
VB.net
Imports System.ComponentModel
|
|
Imports System.IO
|
|
Imports System.Net
|
|
|
|
Public Class radiostore
|
|
Private Sub radiostore_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
|
Dim lines1a() As String = File.ReadAllLines(théme)
|
|
|
|
If lines1a(0) = 2 Then
|
|
ContextMenuStrip1.BackColor = Color.FromArgb(64, 64, 64)
|
|
ContextMenuStrip2.BackColor = Color.FromArgb(64, 64, 64)
|
|
ContextMenuStrip1.ForeColor = Color.White
|
|
ContextMenuStrip2.ForeColor = Color.White
|
|
Label4.ForeColor = Color.White
|
|
BackColor = Color.FromArgb(64, 64, 64)
|
|
ListBox1.BackColor = Color.FromArgb(64, 64, 64)
|
|
ListBox2.BackColor = Color.FromArgb(64, 64, 64)
|
|
ListBox3.BackColor = Color.FromArgb(64, 64, 64)
|
|
Button1.BackColor = Color.FromArgb(64, 64, 64)
|
|
PictureBox1.BackColor = Color.FromArgb(64, 64, 64)
|
|
Label1.BackColor = Color.FromArgb(64, 64, 64)
|
|
Label2.BackColor = Color.FromArgb(64, 64, 64)
|
|
Label3.BackColor = Color.FromArgb(64, 64, 64)
|
|
ListBox1.ForeColor = Color.White
|
|
ListBox2.ForeColor = Color.White
|
|
ListBox3.ForeColor = Color.White
|
|
Label3.ForeColor = Color.White
|
|
Label1.ForeColor = Color.White
|
|
Label2.ForeColor = Color.White
|
|
Button1.ForeColor = Color.White
|
|
ElseIf lines1a(0) = 3 Then
|
|
TéléchargerLaRadioSelectionnezToolStripMenuItem.Image = Form1.PictureBox10.Image
|
|
ÉcouterToolStripMenuItem.Image = Form1.PictureBox7.Image
|
|
PictureBox2.Image = Form1.PictureBox5.Image
|
|
ContextMenuStrip1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
ContextMenuStrip2.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
ContextMenuStrip1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
ContextMenuStrip2.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
Label4.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
ListBox1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
ListBox2.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
ListBox3.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
Button1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
PictureBox1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
Label1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
Label2.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
Label3.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
ListBox1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
ListBox2.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
ListBox3.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
Label3.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)
|
|
Button1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
End If
|
|
|
|
Dim lines1() As String = File.ReadAllLines(comtpeco2)
|
|
If lines1(0) = 1 Then
|
|
PictureBox1.Image = Form3.PictureBox2.Image
|
|
Button1.Show()
|
|
vérifico()
|
|
Else
|
|
PictureBox1.Hide()
|
|
Button1.Hide()
|
|
TabControl1.TabPages.Remove(TabPage3)
|
|
ftp()
|
|
End If
|
|
End Sub
|
|
Sub ftp()
|
|
Try
|
|
ListBox1.Items.Clear()
|
|
Dim fwr As FtpWebRequest
|
|
fwr = FtpWebRequest.Create(ipserver & "/radio/")
|
|
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
|
|
|
|
ListBox1.Items.Add(str)
|
|
|
|
|
|
str = sr.ReadLine()
|
|
End While
|
|
|
|
sr.Close()
|
|
|
|
If ListBox1.Items.Count = 0 Then
|
|
Label1.Show()
|
|
Else
|
|
Label1.Hide()
|
|
End If
|
|
|
|
lischargradio()
|
|
|
|
Catch ex As Exception
|
|
Timer1.Start()
|
|
End Try
|
|
End Sub
|
|
|
|
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
|
|
Timer1.Stop()
|
|
Try
|
|
ListBox1.Items.Clear()
|
|
Dim fwr As FtpWebRequest
|
|
fwr = FtpWebRequest.Create(ipserver & "/radio/")
|
|
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
|
|
|
|
ListBox1.Items.Add(str)
|
|
|
|
|
|
str = sr.ReadLine()
|
|
End While
|
|
|
|
sr.Close()
|
|
|
|
If ListBox1.Items.Count = 0 Then
|
|
Label1.Show()
|
|
Else
|
|
Label1.Hide()
|
|
End If
|
|
|
|
lischargradio()
|
|
Catch ex As Exception
|
|
Timer1.Start()
|
|
End Try
|
|
End Sub
|
|
|
|
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
|
Form31.ShowDialog()
|
|
End Sub
|
|
Sub vérifico()
|
|
Try
|
|
Dim maj As New WebClient
|
|
Dim vri As String = maj.DownloadString(ipsite & "/utilisateur/" & Form3.Label21.Text & "/modo.txt")
|
|
SupprimerLaRadioToolStripMenuItem.Visible = True
|
|
Catch ex As Exception
|
|
|
|
End Try
|
|
|
|
Try
|
|
Dim fwr As FtpWebRequest
|
|
fwr = FtpWebRequest.Create(ipserver & "/utilisateur/" & Form3.Label21.Text & "/")
|
|
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
|
|
|
|
Directory.CreateDirectory(cozip & str)
|
|
|
|
|
|
str = sr.ReadLine()
|
|
|
|
End While
|
|
|
|
sr.Close()
|
|
|
|
If Directory.Exists(cozip & "radio") = True Then
|
|
For Each fichier As String In IO.Directory.GetDirectories(cozip)
|
|
Dim info As New IO.DirectoryInfo(fichier)
|
|
Directory.Delete(cozip & info.Name)
|
|
Next
|
|
ftp2()
|
|
Else
|
|
For Each fichier As String In IO.Directory.GetDirectories(cozip)
|
|
Dim info As New IO.DirectoryInfo(fichier)
|
|
Directory.Delete(cozip & info.Name)
|
|
Next
|
|
addamis()
|
|
End If
|
|
|
|
Catch ex As Exception
|
|
Timer2.Start()
|
|
End Try
|
|
End Sub
|
|
Sub addamis()
|
|
Try
|
|
Dim MaRequete As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create(ipserver & "/Utilisateur/" & Form3.Label21.Text & "/radio"), System.Net.FtpWebRequest)
|
|
Dim ftpStream As Stream = Nothing
|
|
|
|
MaRequete.Credentials = New System.Net.NetworkCredential("yoannsafe", passftp)
|
|
MaRequete.Method = System.Net.WebRequestMethods.Ftp.MakeDirectory
|
|
|
|
Dim response As FtpWebResponse = CType(MaRequete.GetResponse, FtpWebResponse)
|
|
ftpStream = response.GetResponseStream
|
|
ftpStream.Close()
|
|
response.Close()
|
|
|
|
ftp2()
|
|
Catch ex As Exception
|
|
Timer3.Start()
|
|
End Try
|
|
End Sub
|
|
|
|
Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
|
|
Timer2.Stop()
|
|
|
|
Try
|
|
Dim fwr As FtpWebRequest
|
|
fwr = FtpWebRequest.Create(ipserver & "/utilisateur/" & Form3.Label21.Text & "/")
|
|
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
|
|
|
|
Directory.CreateDirectory(cozip & str)
|
|
|
|
|
|
str = sr.ReadLine()
|
|
|
|
End While
|
|
|
|
sr.Close()
|
|
|
|
If Directory.Exists(cozip & "radio") = True Then
|
|
For Each fichier As String In IO.Directory.GetDirectories(cozip)
|
|
Dim info As New IO.DirectoryInfo(fichier)
|
|
Directory.Delete(cozip & info.Name)
|
|
Next
|
|
ftp2()
|
|
Else
|
|
For Each fichier As String In IO.Directory.GetDirectories(cozip)
|
|
Dim info As New IO.DirectoryInfo(fichier)
|
|
Directory.Delete(cozip & info.Name)
|
|
Next
|
|
addamis()
|
|
End If
|
|
|
|
Catch ex As Exception
|
|
Timer2.Start()
|
|
End Try
|
|
End Sub
|
|
|
|
Private Sub Timer3_Tick(sender As Object, e As EventArgs) Handles Timer3.Tick
|
|
Timer3.Stop()
|
|
Try
|
|
Dim MaRequete As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create(ipserver & "/Utilisateur/" & Form3.Label21.Text & "/radio"), System.Net.FtpWebRequest)
|
|
Dim ftpStream As Stream = Nothing
|
|
|
|
MaRequete.Credentials = New System.Net.NetworkCredential("yoannsafe", passftp)
|
|
MaRequete.Method = System.Net.WebRequestMethods.Ftp.MakeDirectory
|
|
|
|
Dim response As FtpWebResponse = CType(MaRequete.GetResponse, FtpWebResponse)
|
|
ftpStream = response.GetResponseStream
|
|
ftpStream.Close()
|
|
response.Close()
|
|
ftp2()
|
|
Catch ex As Exception
|
|
Timer3.Start()
|
|
End Try
|
|
End Sub
|
|
Sub ftp2()
|
|
Try
|
|
ListBox2.Items.Clear()
|
|
Dim fwr As FtpWebRequest
|
|
fwr = FtpWebRequest.Create(ipserver & "/utilisateur/" & Form3.Label21.Text & "/radio/")
|
|
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
|
|
|
|
ListBox2.Items.Add(str)
|
|
|
|
|
|
str = sr.ReadLine()
|
|
End While
|
|
|
|
sr.Close()
|
|
|
|
If ListBox2.Items.Count = 0 Then
|
|
Label2.Show()
|
|
Else
|
|
Label2.Hide()
|
|
End If
|
|
|
|
ftp()
|
|
|
|
Catch ex As Exception
|
|
Timer4.Start()
|
|
End Try
|
|
End Sub
|
|
|
|
Private Sub Timer4_Tick(sender As Object, e As EventArgs) Handles Timer4.Tick
|
|
Timer4.Stop()
|
|
Try
|
|
ListBox2.Items.Clear()
|
|
Dim fwr As FtpWebRequest
|
|
fwr = FtpWebRequest.Create(ipserver & "/utilisateur/" & Form3.Label21.Text & "/radio/")
|
|
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
|
|
|
|
ListBox2.Items.Add(str)
|
|
|
|
|
|
str = sr.ReadLine()
|
|
End While
|
|
|
|
sr.Close()
|
|
|
|
If ListBox2.Items.Count = 0 Then
|
|
Label2.Show()
|
|
Else
|
|
Label2.Hide()
|
|
End If
|
|
|
|
ftp()
|
|
|
|
Catch ex As Exception
|
|
Timer4.Start()
|
|
End Try
|
|
End Sub
|
|
|
|
Private Sub ContextMenuStrip1_Opening(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles ContextMenuStrip1.Opening
|
|
If ListBox1.SelectedItem = "" Then
|
|
e.Cancel = True
|
|
Else
|
|
TéléchargerLaRadioSelectionnezToolStripMenuItem.Text = "Télécharger la radio: " & ListBox1.SelectedItem
|
|
InformationToolStripMenuItem.Text = "Information sur la radio: " & ListBox1.SelectedItem
|
|
ÉcouterToolStripMenuItem.Text = "Écouter: " & ListBox1.SelectedItem
|
|
SupprimerLaRadioToolStripMenuItem.Text = "supprimer la radio: " & ListBox1.SelectedItem
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub InformationToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles InformationToolStripMenuItem.Click
|
|
Dim maj As New WebClient
|
|
Dim vri As String = maj.DownloadString(ipsite & "/radio/" & ListBox1.SelectedItem & "/auteur.txt")
|
|
MsgBox("Publier par: " & vri, MsgBoxStyle.Information)
|
|
End Sub
|
|
|
|
Private Sub TéléchargerLaRadioSelectionnezToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles TéléchargerLaRadioSelectionnezToolStripMenuItem.Click
|
|
If Directory.Exists(radio & "\" & ListBox1.SelectedItem) = True Then
|
|
MsgBox("La radio: " & ListBox1.SelectedItem & " existe déjà", MsgBoxStyle.Critical)
|
|
Else
|
|
Directory.CreateDirectory(radio & "\" & ListBox1.SelectedItem & "\")
|
|
My.Computer.Network.DownloadFile(ipsite & "/radio/" & ListBox1.SelectedItem & "/flux.txt", radio & "\" & ListBox1.SelectedItem & "\flux.txt")
|
|
Try
|
|
My.Computer.Network.DownloadFile(ipsite & "/radio/" & ListBox1.SelectedItem & "/photo.png", radio & "\" & ListBox1.SelectedItem & "\photo.png")
|
|
Catch ex As Exception
|
|
|
|
End Try
|
|
|
|
MsgBox("La radio: " & ListBox1.SelectedItem & " a bien été télécharger", MsgBoxStyle.Information)
|
|
|
|
ListBox3.Items.Clear()
|
|
|
|
For Each fichier As String In IO.Directory.GetDirectories(radio)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
ListBox3.Items.Add(info.Name)
|
|
Next
|
|
|
|
|
|
If ListBox3.Items.Count = 0 Then
|
|
Label3.Show()
|
|
Else
|
|
Label3.Hide()
|
|
End If
|
|
|
|
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)
|
|
Form3.ComboBox6.Items.Clear()
|
|
Form3.ComboBox5.Items.Clear()
|
|
Next
|
|
For Each fichier As String In IO.Directory.GetDirectories(radio)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Form1.ComboBox1.Items.Add(info.Name)
|
|
Form8.ComboBox1.Items.Add(info.Name)
|
|
Form3.ComboBox6.Items.Add(info.Name)
|
|
Form3.ComboBox5.Items.Add(info.Name)
|
|
Next
|
|
|
|
End If
|
|
End Sub
|
|
Sub lischargradio()
|
|
ListBox3.Items.Clear()
|
|
|
|
For Each fichier As String In IO.Directory.GetDirectories(radio)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
ListBox3.Items.Add(info.Name)
|
|
Next
|
|
|
|
|
|
If ListBox3.Items.Count = 0 Then
|
|
Label3.Show()
|
|
Else
|
|
Label3.Hide()
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub ContextMenuStrip2_Opening(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles ContextMenuStrip2.Opening
|
|
If ListBox2.SelectedItem = "" Then
|
|
e.Cancel = True
|
|
Else
|
|
ToolStripMenuItem1.Text = "Supprimer: " & ListBox2.SelectedItem
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub ToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItem1.Click
|
|
Try
|
|
Dim ftreq2 As FtpWebRequest = FtpWebRequest.Create(ipserver & "/radio/" & ListBox2.SelectedItem & "/flux.txt")
|
|
ftreq2.Method = WebRequestMethods.Ftp.DeleteFile
|
|
ftreq2.Credentials = New NetworkCredential("yoannsafe", passftp)
|
|
Dim ftpresp2 As FtpWebResponse = ftreq2.GetResponse
|
|
Catch ex As Exception
|
|
|
|
End Try
|
|
|
|
Try
|
|
Dim ftreq2 As FtpWebRequest = FtpWebRequest.Create(ipserver & "/radio/" & ListBox2.SelectedItem & "/auteur.txt")
|
|
ftreq2.Method = WebRequestMethods.Ftp.DeleteFile
|
|
ftreq2.Credentials = New NetworkCredential("yoannsafe", passftp)
|
|
Dim ftpresp2 As FtpWebResponse = ftreq2.GetResponse
|
|
Catch ex As Exception
|
|
|
|
End Try
|
|
|
|
Try
|
|
Dim ftreq2 As FtpWebRequest = FtpWebRequest.Create(ipserver & "/radio/" & ListBox2.SelectedItem & "/photo.png")
|
|
ftreq2.Method = WebRequestMethods.Ftp.DeleteFile
|
|
ftreq2.Credentials = New NetworkCredential("yoannsafe", passftp)
|
|
Dim ftpresp2 As FtpWebResponse = ftreq2.GetResponse
|
|
Catch ex As Exception
|
|
|
|
End Try
|
|
|
|
Dim ftreq As FtpWebRequest = FtpWebRequest.Create(ipserver & "/radio/" & ListBox2.SelectedItem & "/")
|
|
ftreq.Method = WebRequestMethods.Ftp.RemoveDirectory
|
|
ftreq.Credentials = New NetworkCredential("yoannsafe", passftp)
|
|
Dim ftpresp As FtpWebResponse = ftreq.GetResponse
|
|
|
|
Dim ftreq3 As FtpWebRequest = FtpWebRequest.Create(ipserver & "/utilisateur/" & Form3.Label21.Text & "/radio/" & ListBox2.SelectedItem & "/")
|
|
ftreq3.Method = WebRequestMethods.Ftp.RemoveDirectory
|
|
ftreq3.Credentials = New NetworkCredential("yoannsafe", passftp)
|
|
Dim ftpresp3 As FtpWebResponse = ftreq3.GetResponse
|
|
|
|
MsgBox("La radio: " & ListBox2.SelectedItem & " a bien été supprimer", MsgBoxStyle.Information)
|
|
ftp2()
|
|
End Sub
|
|
|
|
Private Sub ÉcouterToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ÉcouterToolStripMenuItem.Click
|
|
My.Computer.Network.DownloadFile(ipsite & "/radio/" & ListBox1.SelectedItem & "/flux.txt", radio & "/flux.txt")
|
|
Dim lines1() As String = File.ReadAllLines(radio & "/flux.txt")
|
|
AxWindowsMediaPlayer1.URL = lines1(0)
|
|
File.Delete(radio & "/flux.txt")
|
|
PictureBox2.Show()
|
|
End Sub
|
|
|
|
Private Sub Timer5_Tick(sender As Object, e As EventArgs) Handles Timer5.Tick
|
|
Label4.Text = AxWindowsMediaPlayer1.status
|
|
End Sub
|
|
|
|
Private Sub PictureBox2_Click(sender As Object, e As EventArgs) Handles PictureBox2.Click
|
|
AxWindowsMediaPlayer1.Ctlcontrols.stop()
|
|
AxWindowsMediaPlayer1.currentPlaylist.clear()
|
|
Label4.Text = ""
|
|
PictureBox2.Hide()
|
|
End Sub
|
|
|
|
Private Sub radiostore_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
|
|
AxWindowsMediaPlayer1.Ctlcontrols.stop()
|
|
AxWindowsMediaPlayer1.currentPlaylist.clear()
|
|
Label4.Text = ""
|
|
PictureBox2.Hide()
|
|
End Sub
|
|
|
|
Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
|
|
|
|
End Sub
|
|
|
|
Private Sub SupprimerLaRadioToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SupprimerLaRadioToolStripMenuItem.Click
|
|
Dim msg = MsgBox("Voulez-vous vraiment supprimer la radio: " & ListBox1.SelectedItem, MsgBoxStyle.YesNo)
|
|
If msg = MsgBoxResult.Yes Then
|
|
delradio()
|
|
Else
|
|
MsgBox("action annuler", MsgBoxStyle.Information)
|
|
End If
|
|
End Sub
|
|
Sub delradio()
|
|
My.Computer.Network.DownloadFile(ipsite & "/radio/" & ListBox1.SelectedItem & "/auteur.txt", dosparamètres & "\auteurtems.txt")
|
|
Dim lines1() As String = File.ReadAllLines(dosparamètres & "\auteurtems.txt")
|
|
File.Delete(dosparamètres & "\auteurtems.txt")
|
|
Try
|
|
Dim ftreq2 As FtpWebRequest = FtpWebRequest.Create(ipserver & "/radio/" & ListBox1.SelectedItem & "/flux.txt")
|
|
ftreq2.Method = WebRequestMethods.Ftp.DeleteFile
|
|
ftreq2.Credentials = New NetworkCredential("yoannsafe", passftp)
|
|
Dim ftpresp2 As FtpWebResponse = ftreq2.GetResponse
|
|
Catch ex As Exception
|
|
|
|
End Try
|
|
|
|
Try
|
|
Dim ftreq2 As FtpWebRequest = FtpWebRequest.Create(ipserver & "/radio/" & ListBox1.SelectedItem & "/auteur.txt")
|
|
ftreq2.Method = WebRequestMethods.Ftp.DeleteFile
|
|
ftreq2.Credentials = New NetworkCredential("yoannsafe", passftp)
|
|
Dim ftpresp2 As FtpWebResponse = ftreq2.GetResponse
|
|
Catch ex As Exception
|
|
|
|
End Try
|
|
|
|
Try
|
|
Dim ftreq2 As FtpWebRequest = FtpWebRequest.Create(ipserver & "/radio/" & ListBox1.SelectedItem & "/photo.png")
|
|
ftreq2.Method = WebRequestMethods.Ftp.DeleteFile
|
|
ftreq2.Credentials = New NetworkCredential("yoannsafe", passftp)
|
|
Dim ftpresp2 As FtpWebResponse = ftreq2.GetResponse
|
|
Catch ex As Exception
|
|
|
|
End Try
|
|
|
|
Dim ftreq As FtpWebRequest = FtpWebRequest.Create(ipserver & "/radio/" & ListBox1.SelectedItem & "/")
|
|
ftreq.Method = WebRequestMethods.Ftp.RemoveDirectory
|
|
ftreq.Credentials = New NetworkCredential("yoannsafe", passftp)
|
|
Dim ftpresp As FtpWebResponse = ftreq.GetResponse
|
|
|
|
Dim ftreq3 As FtpWebRequest = FtpWebRequest.Create(ipserver & "/utilisateur/" & lines1(0) & "/radio/" & ListBox1.SelectedItem & "/")
|
|
ftreq3.Method = WebRequestMethods.Ftp.RemoveDirectory
|
|
ftreq3.Credentials = New NetworkCredential("yoannsafe", passftp)
|
|
Dim ftpresp3 As FtpWebResponse = ftreq3.GetResponse
|
|
|
|
MsgBox("La radio: " & ListBox1.SelectedItem & " a bien été supprimer", MsgBoxStyle.Information)
|
|
Dim msg = MsgBox("Voulez-vous envoyer a mail de supprétion a: " & lines1(0), MsgBoxStyle.YesNo)
|
|
If msg = MsgBoxResult.Yes Then
|
|
mailsuppr.nomfile = ListBox1.SelectedItem
|
|
mailsuppr.publier = lines1(0)
|
|
mailsuppr.typfile = "radio"
|
|
mailsuppr.userdladmin = Form3.Label21.Text
|
|
mailsuppr.ShowDialog()
|
|
End If
|
|
ftp2()
|
|
End Sub
|
|
End Class |