Imports System.ComponentModel Imports System.IO Imports System.Net Imports QRCoder Public Class Drive Dim lines() As String = File.ReadAllLines(compteco) Public tcon = lines(0) Public fud As String = "" Dim listb2ab As Integer = 0 Dim LVI As New ListBox Private Sub Drive_Load(sender As Object, e As EventArgs) Handles MyBase.Load ListBox4.Items.Clear() Dim lines1a() As String = File.ReadAllLines(théme) If lines1a(0) = 2 Then ListBox4.BackColor = Color.FromArgb(64, 64, 64) ListBox4.ForeColor = Color.White DéplacerVersToolStripMenuItem.BackColor = Color.FromArgb(64, 64, 64) DéplacerVersToolStripMenuItem1.BackColor = Color.FromArgb(64, 64, 64) DéplacerVersToolStripMenuItem.ForeColor = Color.White DéplacerVersToolStripMenuItem1.ForeColor = Color.White RenomerLeFichierToolStripMenuItem.BackColor = Color.FromArgb(64, 64, 64) RenomerLeFichierToolStripMenuItem1.BackColor = Color.FromArgb(64, 64, 64) RenomerLeFichierToolStripMenuItem.ForeColor = Color.White RenomerLeFichierToolStripMenuItem1.ForeColor = Color.White CréerUnDosierToolStripMenuItem.BackColor = Color.FromArgb(64, 64, 64) CréerUnDossierToolStripMenuItem.BackColor = Color.FromArgb(64, 64, 64) CréerUnDosierToolStripMenuItem.ForeColor = Color.White CréerUnDossierToolStripMenuItem.ForeColor = Color.White Me.BackColor = Color.FromArgb(64, 64, 64) ListBox1.BackColor = Color.FromArgb(64, 64, 64) ListBox1.ForeColor = Color.White MenuStrip1.BackColor = Color.FromArgb(64, 64, 64) MenuStrip1.ForeColor = Color.White CréerUnDosierToolStripMenuItem.BackColor = Color.FromArgb(64, 64, 64) CréerUnDosierToolStripMenuItem.ForeColor = Color.White FichierToolStripMenuItem.BackColor = Color.FromArgb(64, 64, 64) FichierToolStripMenuItem.ForeColor = Color.White EnvoyerUnFichierToolStripMenuItem1.BackColor = Color.FromArgb(64, 64, 64) EnvoyerUnFichierToolStripMenuItem1.ForeColor = Color.White SupprimerLeDossierEtSontContenuSelectionnezToolStripMenuItem.BackColor = Color.FromArgb(64, 64, 64) SupprimerLeDossierEtSontContenuSelectionnezToolStripMenuItem1.BackColor = Color.FromArgb(64, 64, 64) SupprimerLeDossierEtSontContenuSelectionnezToolStripMenuItem.ForeColor = Color.White SupprimerLeDossierEtSontContenuSelectionnezToolStripMenuItem1.ForeColor = Color.White TéléchargerLeFichierSelectionnerToolStripMenuItem1.BackColor = Color.FromArgb(64, 64, 64) TéléchargerLeFichierSelectionnerToolStripMenuItem1.ForeColor = Color.White SupprimerLeFichierSelectionnerToolStripMenuItem1.BackColor = Color.FromArgb(64, 64, 64) SupprimerLeFichierSelectionnerToolStripMenuItem1.ForeColor = Color.White LireLeFichierSelectionnerToolStripMenuItem1.BackColor = Color.FromArgb(64, 64, 64) LireLeFichierSelectionnerToolStripMenuItem1.ForeColor = Color.White PartagerToolStripMenuItem.BackColor = Color.FromArgb(64, 64, 64) PartagerToolStripMenuItem.ForeColor = Color.White CréerUnQRCodelientPourAccéterAuFichierToolStripMenuItem1.BackColor = Color.FromArgb(64, 64, 64) CréerUnQRCodelientPourAccéterAuFichierToolStripMenuItem1.ForeColor = Color.White PartagerLeFichierSelectionnerAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem1.BackColor = Color.FromArgb(64, 64, 64) PartagerLeFichierSelectionnerAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem1.ForeColor = Color.White ActualiserLesFichierToolStripMenuItem.BackColor = Color.FromArgb(64, 64, 64) ActualiserLesFichierToolStripMenuItem.ForeColor = Color.White ContextMenuStrip1.BackColor = Color.FromArgb(64, 64, 64) ContextMenuStrip1.ForeColor = Color.White FichierToolStripMenuItem1.BackColor = Color.FromArgb(64, 64, 64) FichierToolStripMenuItem1.ForeColor = Color.White EnvoyerUnFichierToolStripMenuItem2.BackColor = Color.FromArgb(64, 64, 64) EnvoyerUnFichierToolStripMenuItem2.ForeColor = Color.White TéléchargerLeFichierSelectionnerToolStripMenuItem2.BackColor = Color.FromArgb(64, 64, 64) TéléchargerLeFichierSelectionnerToolStripMenuItem2.ForeColor = Color.White LireLeFichierSelectionnerToolStripMenuItem2.BackColor = Color.FromArgb(64, 64, 64) LireLeFichierSelectionnerToolStripMenuItem2.ForeColor = Color.White SupprimerLeFichierSelectionnerToolStripMenuItem2.BackColor = Color.FromArgb(64, 64, 64) SupprimerLeFichierSelectionnerToolStripMenuItem2.ForeColor = Color.White PartagerToolStripMenuItem1.BackColor = Color.FromArgb(64, 64, 64) PartagerToolStripMenuItem1.ForeColor = Color.White CréerUnQRCodelientPourAccéterAuFichierToolStripMenuItem2.BackColor = Color.FromArgb(64, 64, 64) CréerUnQRCodelientPourAccéterAuFichierToolStripMenuItem2.ForeColor = Color.White PartagerLeFichierSelectionnerAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem2.BackColor = Color.FromArgb(64, 64, 64) PartagerLeFichierSelectionnerAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem2.ForeColor = Color.White ActualiserToolStripMenuItem.BackColor = Color.FromArgb(64, 64, 64) ActualiserLesFichierToolStripMenuItem.BackColor = Color.FromArgb(64, 64, 64) ActualiserLesFichierToolStripMenuItem.ForeColor = Color.White ForeColor = Form1.ForeColor ParterLeFichierAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem.BackColor = BackColor ParterLeFichierAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem1.BackColor = BackColor ParterLeFichierAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem.ForeColor = ForeColor ParterLeFichierAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem1.ForeColor = ForeColor ContextMenuStrip2.BackColor = BackColor ContextMenuStrip2.ForeColor = ForeColor ElseIf lines1a(0) = 3 Then DéplacerVersToolStripMenuItem.BackColor = Form1.BackColor DéplacerVersToolStripMenuItem1.BackColor = Form1.BackColor DéplacerVersToolStripMenuItem.ForeColor = Form1.ForeColor DéplacerVersToolStripMenuItem1.ForeColor = Form1.ForeColor RenomerLeFichierToolStripMenuItem.BackColor = Form1.BackColor RenomerLeFichierToolStripMenuItem1.BackColor = Form1.BackColor RenomerLeFichierToolStripMenuItem.ForeColor = Form1.ForeColor RenomerLeFichierToolStripMenuItem1.ForeColor = Form1.ForeColor ListBox4.BackColor = Form1.BackColor ListBox4.ForeColor = Form1.ForeColor TéléchargerLeFichierSelectionnerToolStripMenuItem1.Image = Form1.PictureBox10.Image TéléchargerLeFichierSelectionnerToolStripMenuItem2.Image = Form1.PictureBox10.Image LireLeFichierSelectionnerToolStripMenuItem1.Image = Form1.PictureBox7.Image LireLeFichierSelectionnerToolStripMenuItem2.Image = Form1.PictureBox7.Image CréerUnDosierToolStripMenuItem.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) CréerUnDossierToolStripMenuItem.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) CréerUnDosierToolStripMenuItem.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) CréerUnDossierToolStripMenuItem.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) Me.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) ListBox1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) ListBox1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) MenuStrip1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) MenuStrip1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) CréerUnDosierToolStripMenuItem.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) CréerUnDosierToolStripMenuItem.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) FichierToolStripMenuItem.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) FichierToolStripMenuItem.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) EnvoyerUnFichierToolStripMenuItem1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) EnvoyerUnFichierToolStripMenuItem1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) SupprimerLeDossierEtSontContenuSelectionnezToolStripMenuItem.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) SupprimerLeDossierEtSontContenuSelectionnezToolStripMenuItem1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) SupprimerLeDossierEtSontContenuSelectionnezToolStripMenuItem.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) SupprimerLeDossierEtSontContenuSelectionnezToolStripMenuItem1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) TéléchargerLeFichierSelectionnerToolStripMenuItem1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) TéléchargerLeFichierSelectionnerToolStripMenuItem1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) SupprimerLeFichierSelectionnerToolStripMenuItem1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) SupprimerLeFichierSelectionnerToolStripMenuItem1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) LireLeFichierSelectionnerToolStripMenuItem1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) LireLeFichierSelectionnerToolStripMenuItem1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) PartagerToolStripMenuItem.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) PartagerToolStripMenuItem.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) CréerUnQRCodelientPourAccéterAuFichierToolStripMenuItem1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) CréerUnQRCodelientPourAccéterAuFichierToolStripMenuItem1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) PartagerLeFichierSelectionnerAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) PartagerLeFichierSelectionnerAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) ActualiserLesFichierToolStripMenuItem.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) ActualiserLesFichierToolStripMenuItem.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) ContextMenuStrip1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) ContextMenuStrip1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) FichierToolStripMenuItem1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) FichierToolStripMenuItem1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) EnvoyerUnFichierToolStripMenuItem2.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) EnvoyerUnFichierToolStripMenuItem2.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) TéléchargerLeFichierSelectionnerToolStripMenuItem2.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) TéléchargerLeFichierSelectionnerToolStripMenuItem2.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) LireLeFichierSelectionnerToolStripMenuItem2.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) LireLeFichierSelectionnerToolStripMenuItem2.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) SupprimerLeFichierSelectionnerToolStripMenuItem2.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) SupprimerLeFichierSelectionnerToolStripMenuItem2.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) PartagerToolStripMenuItem1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) PartagerToolStripMenuItem1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) CréerUnQRCodelientPourAccéterAuFichierToolStripMenuItem2.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) CréerUnQRCodelientPourAccéterAuFichierToolStripMenuItem2.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) PartagerLeFichierSelectionnerAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem2.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) PartagerLeFichierSelectionnerAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem2.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) ActualiserToolStripMenuItem.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) ActualiserLesFichierToolStripMenuItem.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) ActualiserLesFichierToolStripMenuItem.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) ForeColor = Form1.ForeColor ParterLeFichierAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem.BackColor = BackColor ParterLeFichierAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem1.BackColor = BackColor ParterLeFichierAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem.ForeColor = ForeColor ParterLeFichierAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem1.ForeColor = ForeColor ContextMenuStrip2.BackColor = BackColor ContextMenuStrip2.ForeColor = ForeColor End If Dim lines102() As String = File.ReadAllLines(couleur) If lines102(0) = 0 Then ChromeTabcontrol1.SquareColor = Color.FromArgb(255, 128, 0) ElseIf lines102(0) = 1 Then ChromeTabcontrol1.SquareColor = Color.Green ElseIf lines102(0) = 2 Then ChromeTabcontrol1.SquareColor = Color.Blue ElseIf lines102(0) = 3 Then ChromeTabcontrol1.SquareColor = Color.Red End If ListBox1.AllowDrop = True Dim lines() As String = File.ReadAllLines(compteco) tcon = Form3.Label21.Text If tcon = "Flawzie_" Then OpenFileDialog1.Filter = "tout les fichier|*.**" End If Me.Text = "Drive: " & tcon Try Dim fwr As FtpWebRequest fwr = FtpWebRequest.Create(ipserver & "/" & "Utilisateur" & "/" & tcon & "/" & "Dirve" & "/") 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.Replace(".txt", ".plm")) If str.EndsWith(".mp4") Or str.EndsWith(".mkv") Or str.EndsWith(".ts") Or str.ToString.EndsWith(".avi") Or str.EndsWith(".mov") Or str.EndsWith(".wmv") Or str.EndsWith(".mp3") Then Else End If str = sr.ReadLine() End While sr.Close() ListBox1.Items.Remove("index.php") Catch ex As Exception ListBox1.Items.Clear() ftp() End Try If ListBox1.Items.Count = 0 Then Else ListBox1.SelectedIndex = 0 End If Dim fwr2 As FtpWebRequest fwr2 = FtpWebRequest.Create(ipserver & "/Utilisateur/" & tcon & "/") 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() While Not str2 Is Nothing If str2.Contains("driveattfile") = True Then ListBox3.Items.Add(str2) End If str2 = sr2.ReadLine() End While sr2.Close() If ListBox3.Items.Count = 1 Then Dim fwr3 As FtpWebRequest fwr3 = FtpWebRequest.Create(ipserver & "/Utilisateur/" & tcon & "/driveattfile/") fwr3.Credentials = New NetworkCredential("yoannsafe", passftp) fwr3.Method = WebRequestMethods.Ftp.ListDirectory Dim sr3 As New StreamReader(fwr3.GetResponse().GetResponseStream()) Dim str3 As String = sr3.ReadLine() While Not str3 Is Nothing ListBox4.Items.Add(str3.Replace(".txt", ".plm")) str3 = sr3.ReadLine() End While sr3.Close() TabPage3.Text = "Fichier en attente (" & ListBox4.Items.Count & ")" Else Dim MaRequete As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create(ipserver & "/Utilisateur/" & tcon & "/driveattfile/"), 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() Dim fwr3 As FtpWebRequest fwr3 = FtpWebRequest.Create(ipserver & "/Utilisateur/" & tcon & "/driveattfile/") fwr3.Credentials = New NetworkCredential("yoannsafe", passftp) fwr3.Method = WebRequestMethods.Ftp.ListDirectory Dim sr3 As New StreamReader(fwr3.GetResponse().GetResponseStream()) Dim str3 As String = sr3.ReadLine() While Not str3 Is Nothing ListBox4.Items.Add(str3.Replace(".txt", ".plm")) str3 = sr3.ReadLine() End While sr3.Close() End If End Sub Private Sub Drive_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing ListBox1.Items.Clear() TextBox1.Clear() ListBox2.Items.Clear() End Sub Sub ftp() Me.Text = "Drive: " & tcon ListBox1.Items.Clear() ListBox4.Items.Clear() If TextBox1.Text = "" Then Try PictureBox1.Hide() Me.Text = "Drive: " & tcon Dim fwr As FtpWebRequest fwr = FtpWebRequest.Create(ipserver & "/" & "Utilisateur" & "/" & tcon & "/" & "Dirve" & "/") 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.Replace(".txt", ".plm")) str = sr.ReadLine() End While sr.Close() ListBox1.Items.Remove("index.php") Catch ex As Exception ListBox1.Items.Clear() ftp() End Try Else Try PictureBox1.Show() Me.Text = "Drive: " & tcon & " " & TextBox1.Text Dim fwr As FtpWebRequest fwr = FtpWebRequest.Create(ipserver & "/" & "Utilisateur" & "/" & tcon & "/" & "Dirve" & TextBox1.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 ListBox1.Items.Add(str.Replace(".txt", ".plm")) str = sr.ReadLine() End While sr.Close() ListBox1.Items.Remove("index.php") Catch ex As Exception ListBox1.Items.Clear() ftp() End Try End If If ListBox1.Items.Count = 0 Then Else ListBox1.SelectedIndex = 0 End If Dim fwr3 As FtpWebRequest fwr3 = FtpWebRequest.Create(ipserver & "/Utilisateur/" & tcon & "/driveattfile/") fwr3.Credentials = New NetworkCredential("yoannsafe", passftp) fwr3.Method = WebRequestMethods.Ftp.ListDirectory Dim sr3 As New StreamReader(fwr3.GetResponse().GetResponseStream()) Dim str3 As String = sr3.ReadLine() While Not str3 Is Nothing ListBox4.Items.Add(str3.Replace(".txt", ".plm")) str3 = sr3.ReadLine() End While TabPage3.Text = "Fichier en attente (" & ListBox4.Items.Count & ")" sr3.Close() End Sub Private Sub EnvoyerUnFichierToolStripMenuItem_Click(sender As Object, e As EventArgs) If OpenFileDialog1.ShowDialog = 1 Then Drive4.ShowDialog() End If End Sub Private Sub TéléchargerLeFichierSelectionnerToolStripMenuItem_Click(sender As Object, e As EventArgs) If FolderBrowserDialog1.ShowDialog = 1 Then Drive3.ShowDialog() End If End Sub Private Sub LireLeFichierSelectionnerToolStripMenuItem_Click(sender As Object, e As EventArgs) Form1.AxWindowsMediaPlayer1.URL = "http://192.168.1.29:81/" & "Utilisateur" & "/" & tcon & "/" & "Dirve" & "/" & ListBox1.SelectedItem Form1.PictureBox1.Hide() Close() End Sub Private Sub PartagerLeFichierSelectionnerAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem_Click(sender As Object, e As EventArgs) Drive2.ShowDialog() End Sub Private Sub ActualiserLesFichierToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ActualiserLesFichierToolStripMenuItem.Click ListBox1.Items.Clear() ftp() End Sub Private Sub Drive_KeyDown(sender As Object, e As KeyEventArgs) Handles MyBase.KeyDown If e.KeyData = Keys.F5 Then ListBox1.Items.Clear() ftp() Exit Sub ElseIf e.KeyData = Keys.Delete Then supprimer() Exit Sub ElseIf e.KeyData = Keys.Enter Then Try If ListBox1.SelectedItem = "" Then Exit Sub End If If ListBox1.SelectedItem.ToString.EndsWith(".mp4") Or ListBox1.SelectedItem.ToString.EndsWith(".mkv") Or ListBox1.SelectedItem.ToString.EndsWith(".ts") Or ListBox1.SelectedItem.ToString.EndsWith(".avi") Or ListBox1.SelectedItem.ToString.EndsWith(".mov") Or ListBox1.SelectedItem.ToString.EndsWith(".wmv") Or ListBox1.SelectedItem.ToString.EndsWith(".mp3") Or ListBox1.SelectedItem.ToString.EndsWith(".plm") Then lire() Exit Sub ElseIf ListBox1.SelectedItem.ToString.EndsWith(".zip") Then Exit Sub Else Try Dim fwr As FtpWebRequest fwr = FtpWebRequest.Create(ipserver & "/" & "Utilisateur" & "/" & tcon & "/" & "Dirve" & "/" & ListBox1.SelectedItem) Me.Text = Me.Text & "/" & ListBox1.SelectedItem TextBox1.Text = "/" & ListBox1.SelectedItem fwr.Credentials = New NetworkCredential("yoannsafe", passftp) fwr.Method = WebRequestMethods.Ftp.ListDirectory Dim sr As New StreamReader(fwr.GetResponse().GetResponseStream()) ListBox1.Items.Clear() Dim str As String = sr.ReadLine() While Not str Is Nothing ListBox1.Items.Add(str) str = sr.ReadLine() End While sr.Close() ListBox1.Items.Remove("index.php") CréerUnDosierToolStripMenuItem.Visible = False CréerUnDossierToolStripMenuItem.Visible = False SupprimerLeDossierEtSontContenuSelectionnezToolStripMenuItem.Visible = False SupprimerLeDossierEtSontContenuSelectionnezToolStripMenuItem1.Visible = False ftp() Catch ex As Exception ListBox1.Items.Clear() ftp() End Try End If Catch ex As Exception End Try End If End Sub Private Sub EnvoyerUnFichierToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles EnvoyerUnFichierToolStripMenuItem1.Click upload() End Sub Private Sub TéléchargerLeFichierSelectionnerToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles TéléchargerLeFichierSelectionnerToolStripMenuItem1.Click download() End Sub Private Sub LireLeFichierSelectionnerToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles LireLeFichierSelectionnerToolStripMenuItem1.Click lire() End Sub Private Sub SupprimerLeFichierSelectionnerToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles SupprimerLeFichierSelectionnerToolStripMenuItem1.Click supprimer() End Sub Private Sub CréerUnQRCodelientPourAccéterAuFichierToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles CréerUnQRCodelientPourAccéterAuFichierToolStripMenuItem1.Click QR() End Sub Private Sub PartagerLeFichierSelectionnerAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles PartagerLeFichierSelectionnerAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem1.Click partage() End Sub Private Sub ActualiserToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ActualiserToolStripMenuItem.Click ListBox1.Items.Clear() ListBox4.Items.Clear() ftp() End Sub Sub upload() If OpenFileDialog1.ShowDialog = 1 Then If OpenFileDialog1.FileName.Contains("#") Then MsgBox("Le caractère: # est interdit", MsgBoxStyle.Critical) Else Drive4.ShowDialog() End If End If End Sub Private Sub EnvoyerUnFichierToolStripMenuItem2_Click(sender As Object, e As EventArgs) Handles EnvoyerUnFichierToolStripMenuItem2.Click upload() End Sub Sub download() If ListBox1.SelectedItem = "" Then MsgBox("Merci de sélectionner un fichier", MsgBoxStyle.Information) Else If FolderBrowserDialog1.ShowDialog = 1 Then Drive3.ShowDialog() End If End If End Sub Private Sub TéléchargerLeFichierSelectionnerToolStripMenuItem2_Click(sender As Object, e As EventArgs) Handles TéléchargerLeFichierSelectionnerToolStripMenuItem2.Click download() End Sub Sub lire() If ListBox1.SelectedItem = "" Then MsgBox("Merci de sélectionner un fichier", MsgBoxStyle.Information) Else If TextBox1.Text = "" Then Dim lines1222() As String = File.ReadAllLines(settings1) If lines1222(5) = 1 Then Form1.Timer25.Start() End If If ListBox1.SelectedItem.ToString.EndsWith(".mp3") Then Form1.AxWindowsMediaPlayer1.Ctlcontrols.stop() Form1.AxWindowsMediaPlayer1.currentPlaylist.clear() Form1.TextBox1.Text = ListBox1.SelectedItem Form1.AxWindowsMediaPlayer1.URL = ipsite & "/Utilisateur" & "/" & tcon & "/" & "Dirve" & "/" & ListBox1.SelectedItem Form1.Text = lecteurnom & ": " & Form1.AxWindowsMediaPlayer1.currentMedia.name Form1.PictureBox1.Hide() Form1.VitesseToolStripMenuItem.Enabled = True Form1.AllaiAToolStripMenuItem.Enabled = True Form1.PleinToolStripMenuItem.Enabled = False Form1.PlayToolStripMenuItem1.Enabled = False Form1.PauseToolStripMenuItem.Enabled = True Form1.StopToolStripMenuItem.Enabled = True Form1.PictureBox5.Enabled = True Form1.PictureBox7.Hide() Form1.PictureBox1.Hide() Form1.PictureBox2.Show() Form1.PictureBox4.Show() Form1.PictureBox6.Enabled = True Form1.PictureBox7.Enabled = True Form1.NotifyIcon1.BalloonTipTitle = "lecteur média" Form1.NotifyIcon1.BalloonTipText = "vous écouter:" & " " & Form1.AxWindowsMediaPlayer1.currentMedia.name Form1.NotifyIcon1.ShowBalloonTip(1) Close() ElseIf ListBox1.SelectedItem.ToString.EndsWith(".plm") Then My.Computer.Network.DownloadFile(ipsite & "/utilisateur/" & tcon & "/dirve/" & ListBox1.SelectedItem.ToString.Replace(".plm", ".txt"), dosparamètres & "\" & ListBox1.SelectedItem.ToString.Replace(".plm", ".txt")) Dim lines1() As String = File.ReadAllLines(dosparamètres & "\" & ListBox1.SelectedItem.ToString.Replace(".plm", ".txt")) File.Delete(dosparamètres & "\" & ListBox1.SelectedItem.ToString.Replace(".plm", ".txt")) If lines1(0).EndsWith(".mp3") Then Form1.AxWindowsMediaPlayer1.Ctlcontrols.stop() Form1.AxWindowsMediaPlayer1.currentPlaylist.clear() Form1.TextBox1.Text = lines1(0) Form1.AxWindowsMediaPlayer1.URL = lines1(0) Form1.Text = lecteurnom & ": " & Form1.AxWindowsMediaPlayer1.currentMedia.name Form1.PictureBox1.Hide() Form1.VitesseToolStripMenuItem.Enabled = True Form1.AllaiAToolStripMenuItem.Enabled = True Form1.PleinToolStripMenuItem.Enabled = False Form1.PlayToolStripMenuItem1.Enabled = False Form1.PauseToolStripMenuItem.Enabled = True Form1.StopToolStripMenuItem.Enabled = True Form1.PictureBox5.Enabled = True Form1.PictureBox7.Hide() Form1.PictureBox1.Hide() Form1.PictureBox2.Show() Form1.PictureBox4.Show() Form1.PictureBox6.Enabled = True Form1.PictureBox7.Enabled = True Form1.NotifyIcon1.BalloonTipTitle = "lecteur média" Form1.NotifyIcon1.BalloonTipText = "vous écouter:" & " " & Form1.AxWindowsMediaPlayer1.currentMedia.name Form1.NotifyIcon1.ShowBalloonTip(1) Close() Else Form1.TextBox1.Text = ListBox1.SelectedItem Form1.AxWindowsMediaPlayer1.Ctlcontrols.stop() Form1.AxWindowsMediaPlayer1.currentPlaylist.clear() Form1.AxWindowsMediaPlayer1.URL = lines1(0) Form1.Text = lecteurnom & ": " & Form1.AxWindowsMediaPlayer1.currentMedia.name Form1.PictureBox1.Hide() Form1.VitesseToolStripMenuItem.Enabled = True Form1.AllaiAToolStripMenuItem.Enabled = True Form1.PleinToolStripMenuItem.Enabled = True Form1.PlayToolStripMenuItem1.Enabled = False Form1.PauseToolStripMenuItem.Enabled = True Form1.StopToolStripMenuItem.Enabled = True Form1.PictureBox5.Enabled = True Form1.PictureBox7.Hide() Form1.PictureBox1.Hide() Form1.PictureBox2.Hide() Form1.PictureBox4.Show() Form1.PictureBox6.Enabled = True Form1.PictureBox7.Enabled = True Form1.NotifyIcon1.BalloonTipTitle = "lecteur média" Form1.NotifyIcon1.BalloonTipText = "vous regarder:" & " " & Form1.AxWindowsMediaPlayer1.currentMedia.name Form1.NotifyIcon1.ShowBalloonTip(1) Close() End If Else Form1.TextBox1.Text = ListBox1.SelectedItem Form1.AxWindowsMediaPlayer1.Ctlcontrols.stop() Form1.AxWindowsMediaPlayer1.currentPlaylist.clear() Form1.AxWindowsMediaPlayer1.URL = ipsite & "/Utilisateur" & "/" & tcon & "/" & "Dirve" & "/" & ListBox1.SelectedItem Form1.Text = lecteurnom & ": " & Form1.AxWindowsMediaPlayer1.currentMedia.name Form1.PictureBox1.Hide() Form1.VitesseToolStripMenuItem.Enabled = True Form1.AllaiAToolStripMenuItem.Enabled = True Form1.PleinToolStripMenuItem.Enabled = True Form1.PlayToolStripMenuItem1.Enabled = False Form1.PauseToolStripMenuItem.Enabled = True Form1.StopToolStripMenuItem.Enabled = True Form1.PictureBox5.Enabled = True Form1.PictureBox7.Hide() Form1.PictureBox1.Hide() Form1.PictureBox2.Hide() Form1.PictureBox4.Show() Form1.PictureBox6.Enabled = True Form1.PictureBox7.Enabled = True Form1.NotifyIcon1.BalloonTipTitle = "lecteur média" Form1.NotifyIcon1.BalloonTipText = "vous regarder:" & " " & Form1.AxWindowsMediaPlayer1.currentMedia.name Form1.NotifyIcon1.ShowBalloonTip(1) Close() End If Else If ListBox1.SelectedItem.ToString.EndsWith(".mp3") Then Form1.TextBox1.Text = ListBox1.SelectedItem Form1.AxWindowsMediaPlayer1.Ctlcontrols.stop() Form1.AxWindowsMediaPlayer1.currentPlaylist.clear() Form1.AxWindowsMediaPlayer1.URL = ipsite & "/Utilisateur" & "/" & tcon & "/" & "Dirve" & "/" & TextBox1.Text & "/" & ListBox1.SelectedItem Form1.Text = lecteurnom & ": " & Form1.AxWindowsMediaPlayer1.currentMedia.name Form1.PictureBox1.Hide() Form1.VitesseToolStripMenuItem.Enabled = True Form1.AllaiAToolStripMenuItem.Enabled = True Form1.PleinToolStripMenuItem.Enabled = False Form1.PlayToolStripMenuItem1.Enabled = False Form1.PauseToolStripMenuItem.Enabled = True Form1.StopToolStripMenuItem.Enabled = True Form1.PictureBox5.Enabled = True Form1.PictureBox7.Hide() Form1.PictureBox1.Hide() Form1.PictureBox2.Show() Form1.PictureBox4.Show() Form1.PictureBox6.Enabled = True Form1.PictureBox7.Enabled = True Form1.NotifyIcon1.BalloonTipTitle = "lecteur média" Form1.NotifyIcon1.BalloonTipText = "vous écouter:" & " " & Form1.AxWindowsMediaPlayer1.currentMedia.name Form1.NotifyIcon1.ShowBalloonTip(1) Close() ElseIf ListBox1.SelectedItem.ToString.EndsWith(".plm") Then My.Computer.Network.DownloadFile(ipsite & "/utilisateur/" & tcon & "/dirve/" & TextBox1.Text & "/" & ListBox1.SelectedItem.ToString.Replace(".plm", ".txt"), dosparamètres & "\" & ListBox1.SelectedItem.ToString.Replace(".plm", ".txt")) Dim lines1() As String = File.ReadAllLines(dosparamètres & "\" & ListBox1.SelectedItem.ToString.Replace(".plm", ".txt")) File.Delete(dosparamètres & "\" & ListBox1.SelectedItem.ToString.Replace(".plm", ".txt")) If lines1(0).EndsWith(".mp3") Then Form1.AxWindowsMediaPlayer1.Ctlcontrols.stop() Form1.AxWindowsMediaPlayer1.currentPlaylist.clear() Form1.TextBox1.Text = lines1(0) Form1.AxWindowsMediaPlayer1.URL = lines1(0) Form1.Text = lecteurnom & ": " & Form1.AxWindowsMediaPlayer1.currentMedia.name Form1.PictureBox1.Hide() Form1.VitesseToolStripMenuItem.Enabled = True Form1.AllaiAToolStripMenuItem.Enabled = True Form1.PleinToolStripMenuItem.Enabled = False Form1.PlayToolStripMenuItem1.Enabled = False Form1.PauseToolStripMenuItem.Enabled = True Form1.StopToolStripMenuItem.Enabled = True Form1.PictureBox5.Enabled = True Form1.PictureBox7.Hide() Form1.PictureBox1.Hide() Form1.PictureBox2.Show() Form1.PictureBox4.Show() Form1.PictureBox6.Enabled = True Form1.PictureBox7.Enabled = True Form1.NotifyIcon1.BalloonTipTitle = "lecteur média" Form1.NotifyIcon1.BalloonTipText = "vous écouter:" & " " & Form1.AxWindowsMediaPlayer1.currentMedia.name Form1.NotifyIcon1.ShowBalloonTip(1) Close() Else Form1.TextBox1.Text = ListBox1.SelectedItem Form1.AxWindowsMediaPlayer1.Ctlcontrols.stop() Form1.AxWindowsMediaPlayer1.currentPlaylist.clear() Form1.AxWindowsMediaPlayer1.URL = lines1(0) Form1.Text = lecteurnom & ": " & Form1.AxWindowsMediaPlayer1.currentMedia.name Form1.PictureBox1.Hide() Form1.VitesseToolStripMenuItem.Enabled = True Form1.AllaiAToolStripMenuItem.Enabled = True Form1.PleinToolStripMenuItem.Enabled = True Form1.PlayToolStripMenuItem1.Enabled = False Form1.PauseToolStripMenuItem.Enabled = True Form1.StopToolStripMenuItem.Enabled = True Form1.PictureBox5.Enabled = True Form1.PictureBox7.Hide() Form1.PictureBox1.Hide() Form1.PictureBox2.Hide() Form1.PictureBox4.Show() Form1.PictureBox6.Enabled = True Form1.PictureBox7.Enabled = True Form1.NotifyIcon1.BalloonTipTitle = "lecteur média" Form1.NotifyIcon1.BalloonTipText = "vous regarder:" & " " & Form1.AxWindowsMediaPlayer1.currentMedia.name Form1.NotifyIcon1.ShowBalloonTip(1) Close() End If Else Form1.TextBox1.Text = ListBox1.SelectedItem Form1.AxWindowsMediaPlayer1.Ctlcontrols.stop() Form1.AxWindowsMediaPlayer1.currentPlaylist.clear() Form1.AxWindowsMediaPlayer1.URL = ipsite & "/Utilisateur" & "/" & tcon & "/" & "Dirve" & "/" & TextBox1.Text & "/" & ListBox1.SelectedItem Form1.Text = lecteurnom & ": " & Form1.AxWindowsMediaPlayer1.currentMedia.name Form1.PictureBox1.Hide() Form1.VitesseToolStripMenuItem.Enabled = True Form1.AllaiAToolStripMenuItem.Enabled = True Form1.PleinToolStripMenuItem.Enabled = True Form1.PlayToolStripMenuItem1.Enabled = False Form1.PauseToolStripMenuItem.Enabled = True Form1.StopToolStripMenuItem.Enabled = True Form1.PictureBox5.Enabled = True Form1.PictureBox7.Hide() Form1.PictureBox1.Hide() Form1.PictureBox2.Hide() Form1.PictureBox4.Show() Form1.PictureBox6.Enabled = True Form1.PictureBox7.Enabled = True Form1.NotifyIcon1.BalloonTipTitle = "lecteur média" Form1.NotifyIcon1.BalloonTipText = "vous regarder:" & " " & Form1.AxWindowsMediaPlayer1.currentMedia.name Form1.NotifyIcon1.ShowBalloonTip(1) Close() End If End If End If End Sub Private Sub LireLeFichierSelectionnerToolStripMenuItem2_Click(sender As Object, e As EventArgs) Handles LireLeFichierSelectionnerToolStripMenuItem2.Click lire() End Sub Sub supprimer() If ListBox1.SelectedItem = "" Then MsgBox("Merci de sélectionner un fichier", MsgBoxStyle.Information) Else Dim msg = MsgBox("Voulez-vous vraiment supprimer le fichier: " & ListBox1.SelectedItem & " ?", MsgBoxStyle.YesNo) If msg = MsgBoxResult.Yes Then If ListBox1.SelectedItem.ToString.EndsWith(".plm") Then Dim ftreq As FtpWebRequest = FtpWebRequest.Create(ipserver & "/Utilisateur/" & tcon & "/Dirve/" & ListBox1.SelectedItem.ToString.Replace(".plm", ".txt")) ftreq.Method = WebRequestMethods.Ftp.DeleteFile ftreq.Credentials = New NetworkCredential("yoannsafe", passftp) Dim ftpresp As FtpWebResponse = ftreq.GetResponse MsgBox("Le fichier: " & ListBox1.SelectedItem & " a bien été supprimer", MsgBoxStyle.Information) ListBox1.Items.Clear() ftp() ElseIf TextBox1.Text = "" Then Dim ftreq As FtpWebRequest = FtpWebRequest.Create(ipserver & "/" & "Utilisateur" & "/" & tcon & "/" & "Dirve" & "/" & ListBox1.SelectedItem) ftreq.Method = WebRequestMethods.Ftp.DeleteFile ftreq.Credentials = New NetworkCredential("yoannsafe", passftp) Dim ftpresp As FtpWebResponse = ftreq.GetResponse MsgBox("Le fichier: " & ListBox1.SelectedItem & " a bien été supprimer", MsgBoxStyle.Information) ListBox1.Items.Clear() ftp() Else Dim ftreq As FtpWebRequest = FtpWebRequest.Create(ipserver & "/" & "Utilisateur" & "/" & tcon & "/" & "Dirve" & TextBox1.Text & "/" & ListBox1.SelectedItem) ftreq.Method = WebRequestMethods.Ftp.DeleteFile ftreq.Credentials = New NetworkCredential("yoannsafe", passftp) Dim ftpresp As FtpWebResponse = ftreq.GetResponse MsgBox("Le fichier: " & ListBox1.SelectedItem & " a bien été supprimer", MsgBoxStyle.Information) ListBox1.Items.Clear() ftp() End If Else MsgBox("Le fichier: " & ListBox1.SelectedItem & " n'a pas été supprimer", MsgBoxStyle.Information) ListBox1.Items.Clear() ftp() End If End If End Sub Private Sub SupprimerLeFichierSelectionnerToolStripMenuItem2_Click(sender As Object, e As EventArgs) Handles SupprimerLeFichierSelectionnerToolStripMenuItem2.Click supprimer() End Sub Sub QR() If ListBox1.SelectedItem = "" Then MsgBox("Merci de sélectionner un fichier", MsgBoxStyle.Information) Else If TextBox1.Text = "" Then Dim gen As New QRCodeGenerator Dim data = gen.CreateQrCode(ipsite & "Utilisateur" & "/" & tcon & "/" & "Dirve" & "/" & ListBox1.SelectedItem, QRCodeGenerator.ECCLevel.Q) Dim code As New QRCode(data) Form135.TextBox1.Text = ipsite & "Utilisateur" & "/" & tcon & "/" & "Dirve" & "/" & ListBox1.SelectedItem Form135.PictureBox1.Image = code.GetGraphic(6) Form135.ShowDialog() Else Dim gen As New QRCodeGenerator Dim data = gen.CreateQrCode(ipsite & "Utilisateur" & "/" & tcon & "/" & "Dirve" & TextBox1.Text & "/" & ListBox1.SelectedItem, QRCodeGenerator.ECCLevel.Q) Dim code As New QRCode(data) Form135.TextBox1.Text = ipsite & "Utilisateur" & "/" & tcon & "/" & "Dirve" & TextBox1.Text & "/" & ListBox1.SelectedItem Form135.PictureBox1.Image = code.GetGraphic(6) Form135.ShowDialog() End If End If End Sub Private Sub CréerUnQRCodelientPourAccéterAuFichierToolStripMenuItem2_Click(sender As Object, e As EventArgs) Handles CréerUnQRCodelientPourAccéterAuFichierToolStripMenuItem2.Click QR() End Sub Sub partage() If ListBox1.SelectedItem = "" Then MsgBox("Merci de sélectionner un fichier", MsgBoxStyle.Information) Else Drive2.ShowDialog() End If End Sub Private Sub PartagerLeFichierSelectionnerAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem2_Click(sender As Object, e As EventArgs) Handles PartagerLeFichierSelectionnerAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem2.Click partage() End Sub Private Sub ListBox1_DragEnter(sender As Object, e As DragEventArgs) Handles ListBox1.DragEnter If e.Data.GetDataPresent(DataFormats.FileDrop) = True Then Dim file As String = e.Data.GetData(DataFormats.FileDrop)(0) If file.EndsWith(".avi") Or file.EndsWith(".mp4") Or file.EndsWith(".mp3") Or file.EndsWith(".mkv") Or file.EndsWith(".mov") Or file.EndsWith(".wmv") Or file.EndsWith(".ts") Then e.Effect = DragDropEffects.All Else e.Effect = DragDropEffects.None End If End If End Sub Private Sub ListBox1_DragDrop(sender As Object, e As DragEventArgs) Handles ListBox1.DragDrop If e.Data.GetDataPresent(DataFormats.FileDrop) = True Then Dim file As String = e.Data.GetData(DataFormats.FileDrop)(0) If file.Contains("#") Then MsgBox("Le caractère: # est interdit", MsgBoxStyle.Critical) Else OpenFileDialog1.FileName = file drive6.ShowDialog() End If End If End Sub Private Sub ListBox1_DoubleClick(sender As Object, e As EventArgs) Handles ListBox1.DoubleClick Try If ListBox1.SelectedItem = "" Then Exit Sub End If If ListBox1.SelectedItem.ToString.EndsWith(".mp4") Or ListBox1.SelectedItem.ToString.EndsWith(".mkv") Or ListBox1.SelectedItem.ToString.EndsWith(".ts") Or ListBox1.SelectedItem.ToString.EndsWith(".avi") Or ListBox1.SelectedItem.ToString.EndsWith(".mov") Or ListBox1.SelectedItem.ToString.EndsWith(".wmv") Or ListBox1.SelectedItem.ToString.EndsWith(".mp3") Or ListBox1.SelectedItem.ToString.EndsWith(".zip") Or ListBox1.SelectedItem.ToString.EndsWith(".plm") Then Else Try Dim fwr As FtpWebRequest fwr = FtpWebRequest.Create(ipserver & "/" & "Utilisateur" & "/" & tcon & "/" & "Dirve" & "/" & ListBox1.SelectedItem) Me.Text = Me.Text & "/" & ListBox1.SelectedItem TextBox1.Text = "/" & ListBox1.SelectedItem fwr.Credentials = New NetworkCredential("yoannsafe", passftp) fwr.Method = WebRequestMethods.Ftp.ListDirectory Dim sr As New StreamReader(fwr.GetResponse().GetResponseStream()) ListBox1.Items.Clear() Dim str As String = sr.ReadLine() While Not str Is Nothing ListBox1.Items.Add(str) str = sr.ReadLine() End While sr.Close() ListBox1.Items.Remove("index.php") CréerUnDosierToolStripMenuItem.Visible = False CréerUnDossierToolStripMenuItem.Visible = False SupprimerLeDossierEtSontContenuSelectionnezToolStripMenuItem.Visible = False SupprimerLeDossierEtSontContenuSelectionnezToolStripMenuItem1.Visible = False ftp() Catch ex As Exception ListBox1.Items.Clear() ftp() End Try End If Catch ex As Exception End Try End Sub Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click TextBox1.Clear() CréerUnDosierToolStripMenuItem.Visible = True CréerUnDossierToolStripMenuItem.Visible = True SupprimerLeDossierEtSontContenuSelectionnezToolStripMenuItem.Visible = True SupprimerLeDossierEtSontContenuSelectionnezToolStripMenuItem1.Visible = True ftp() End Sub Private Sub CréerUnDosierToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CréerUnDosierToolStripMenuItem.Click adddos() End Sub Sub adddos() drive7.ShowDialog() End Sub Private Sub CréerUnDossierToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CréerUnDossierToolStripMenuItem.Click adddos() End Sub Private Sub SupprimerLeDossierEtSontContenuSelectionnezToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SupprimerLeDossierEtSontContenuSelectionnezToolStripMenuItem.Click If ListBox1.SelectedItem = "" Then MsgBox("Merci de sélectionner un fichier", MsgBoxStyle.Critical) Else If ListBox1.SelectedItem.ToString.EndsWith(".mp4") Or ListBox1.SelectedItem.ToString.EndsWith(".mkv") Or ListBox1.SelectedItem.ToString.EndsWith(".ts") Or ListBox1.SelectedItem.ToString.EndsWith(".avi") Or ListBox1.SelectedItem.ToString.EndsWith(".mov") Or ListBox1.SelectedItem.ToString.EndsWith(".wmv") Or ListBox1.SelectedItem.ToString.EndsWith(".mp3") Then Else Dim msg = MsgBox("Voulez-vous vraiment supprimer: " & ListBox1.SelectedItem & " est son contenu ?", MsgBoxStyle.YesNo) If msg = MsgBoxResult.Yes Then deldiossier() Else MsgBox("Action annuler", MsgBoxStyle.Information) End If End If End If End Sub Sub deldiossier() ListBox2.Items.Clear() Try Dim fwr As FtpWebRequest fwr = FtpWebRequest.Create(ipserver & "/" & "Utilisateur" & "/" & tcon & "/" & "Dirve" & "/" & ListBox1.SelectedItem & "/") 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() listb2ab = ListBox2.Items.Count ListBox2.SetSelected(0, True) For x = 1 To ListBox2.Items.Count Dim ftreq2 As FtpWebRequest = FtpWebRequest.Create(ipserver & "/Utilisateur/" & tcon & "/Dirve/" & ListBox1.SelectedItem & "/" & ListBox2.SelectedItem) ftreq2.Method = WebRequestMethods.Ftp.DeleteFile ftreq2.Credentials = New NetworkCredential("yoannsafe", passftp) Dim ftpresp2 As FtpWebResponse = ftreq2.GetResponse listb2ab = listb2ab - 1 ListBox2.SetSelected(listb2ab, True) Next deldossier2() Catch ex As Exception Timer1.Start() End Try End Sub Sub deldossier2() Try Dim ftreq As FtpWebRequest = FtpWebRequest.Create(ipserver & "/" & "Utilisateur" & "/" & tcon & "/" & "Dirve" & "/" & ListBox1.SelectedItem & "/") ftreq.Method = WebRequestMethods.Ftp.RemoveDirectory ftreq.Credentials = New NetworkCredential("yoannsafe", passftp) Dim ftpresp As FtpWebResponse = ftreq.GetResponse Catch ex As Exception deldossier2() End Try listb2ab = 0 ListBox2.Items.Clear() MsgBox("Le dossier: " & ListBox1.SelectedItem & " est sont contenue ont bien été supprimer", MsgBoxStyle.Information) ftp() End Sub Private Sub SupprimerLeDossierEtSontContenuSelectionnezToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles SupprimerLeDossierEtSontContenuSelectionnezToolStripMenuItem1.Click If ListBox1.SelectedItem = "" Then MsgBox("Merci de sélectionnez un dossier", MsgBoxStyle.Critical) Else If ListBox1.SelectedItem.ToString.EndsWith(".mp4") Or ListBox1.SelectedItem.ToString.EndsWith(".mkv") Or ListBox1.SelectedItem.ToString.EndsWith(".ts") Or ListBox1.SelectedItem.ToString.EndsWith(".avi") Or ListBox1.SelectedItem.ToString.EndsWith(".mov") Or ListBox1.SelectedItem.ToString.EndsWith(".wmv") Or ListBox1.SelectedItem.ToString.EndsWith(".mp3") Then Else Dim msg = MsgBox("Voulez-vous vraiment supprimer: " & ListBox1.SelectedItem & " est son contenu ?", MsgBoxStyle.YesNo) If msg = MsgBoxResult.Yes Then deldiossier() Else MsgBox("Action annuler", MsgBoxStyle.Information) End If End If End If End Sub Private Sub ContextMenuStrip1_Opening(sender As Object, e As CancelEventArgs) Handles ContextMenuStrip1.Opening If ListBox1.SelectedItem = "" Then e.Cancel = True End If End Sub Private Sub ListBox1_SelectedValueChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedValueChanged If ListBox1.SelectedItem = "" Then ElseIf ListBox1.SelectedItem.ToString.EndsWith(".zip") Then SupprimerLeFichierSelectionnerToolStripMenuItem2.Visible = True SupprimerLeDossierEtSontContenuSelectionnezToolStripMenuItem1.Visible = False SupprimerLeFichierSelectionnerToolStripMenuItem1.Visible = True SupprimerLeDossierEtSontContenuSelectionnezToolStripMenuItem.Visible = False LireLeFichierSelectionnerToolStripMenuItem2.Visible = False LireLeFichierSelectionnerToolStripMenuItem1.Visible = False TéléchargerLeFichierSelectionnerToolStripMenuItem1.Visible = True TéléchargerLeFichierSelectionnerToolStripMenuItem2.Visible = True PartagerLeFichierSelectionnerAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem2.Visible = True PartagerLeFichierSelectionnerAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem1.Visible = True CréerUnQRCodelientPourAccéterAuFichierToolStripMenuItem1.Visible = True CréerUnQRCodelientPourAccéterAuFichierToolStripMenuItem2.Visible = True SupprimerLeFichierSelectionnerToolStripMenuItem1.Text = "Supprimer le fichier: " & ListBox1.SelectedItem SupprimerLeFichierSelectionnerToolStripMenuItem2.Text = "Supprimer le fichier: " & ListBox1.SelectedItem PartagerLeFichierSelectionnerAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem1.Text = "Copier le fichier: " & ListBox1.SelectedItem & " avec un autre utilisateur de lecteur média" PartagerLeFichierSelectionnerAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem2.Text = "Copier le fichier: " & ListBox1.SelectedItem & " avec un autre utilisateur de lecteur média" ParterLeFichierAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem.Visible = True ParterLeFichierAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem1.Visible = True ParterLeFichierAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem.Text = "Partager le fichier: " & ListBox1.SelectedItem & " avec un autre utilisateur de lecteur média" ParterLeFichierAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem1.Text = "Partager le fichier: " & ListBox1.SelectedItem & " avec un autre utilisateur de lecteur média" TéléchargerLeFichierSelectionnerToolStripMenuItem1.Text = "Télécharger le fichier: " & ListBox1.SelectedItem TéléchargerLeFichierSelectionnerToolStripMenuItem2.Text = "Télécharger le fichier: " & ListBox1.SelectedItem DéplacerVersToolStripMenuItem.Visible = True DéplacerVersToolStripMenuItem1.Visible = True DéplacerVersToolStripMenuItem.Text = "Déplacer: " & ListBox1.SelectedItem & " vers" DéplacerVersToolStripMenuItem1.Text = "Déplacer: " & ListBox1.SelectedItem & " vers" RenomerLeFichierToolStripMenuItem.Visible = True RenomerLeFichierToolStripMenuItem1.Visible = True RenomerLeFichierToolStripMenuItem.Text = "Renommer le fichier: " & ListBox1.SelectedItem RenomerLeFichierToolStripMenuItem1.Text = "Renommer le fichier: " & ListBox1.SelectedItem ElseIf ListBox1.SelectedItem.ToString.EndsWith(".plm") Then SupprimerLeFichierSelectionnerToolStripMenuItem2.Visible = True SupprimerLeDossierEtSontContenuSelectionnezToolStripMenuItem1.Visible = False SupprimerLeFichierSelectionnerToolStripMenuItem1.Visible = True SupprimerLeDossierEtSontContenuSelectionnezToolStripMenuItem.Visible = False LireLeFichierSelectionnerToolStripMenuItem2.Visible = True LireLeFichierSelectionnerToolStripMenuItem1.Visible = True TéléchargerLeFichierSelectionnerToolStripMenuItem1.Visible = True TéléchargerLeFichierSelectionnerToolStripMenuItem2.Visible = True TéléchargerLeFichierSelectionnerToolStripMenuItem1.Text = "Télécharger le fichier: " & ListBox1.SelectedItem TéléchargerLeFichierSelectionnerToolStripMenuItem2.Text = "Télécharger le fichier: " & ListBox1.SelectedItem PartagerLeFichierSelectionnerAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem2.Visible = False PartagerLeFichierSelectionnerAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem1.Visible = False CréerUnQRCodelientPourAccéterAuFichierToolStripMenuItem1.Visible = False CréerUnQRCodelientPourAccéterAuFichierToolStripMenuItem2.Visible = False LireLeFichierSelectionnerToolStripMenuItem1.Text = "Lire le fichier: " & ListBox1.SelectedItem LireLeFichierSelectionnerToolStripMenuItem2.Text = "Lire le fichier: " & ListBox1.SelectedItem SupprimerLeFichierSelectionnerToolStripMenuItem1.Text = "Supprimer le fichier: " & ListBox1.SelectedItem SupprimerLeFichierSelectionnerToolStripMenuItem2.Text = "Supprimer le fichier: " & ListBox1.SelectedItem ParterLeFichierAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem.Visible = False ParterLeFichierAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem1.Visible = False DéplacerVersToolStripMenuItem.Visible = True DéplacerVersToolStripMenuItem1.Visible = True DéplacerVersToolStripMenuItem.Text = "Déplacer: " & ListBox1.SelectedItem & " vers" DéplacerVersToolStripMenuItem1.Text = "Déplacer: " & ListBox1.SelectedItem & " vers" RenomerLeFichierToolStripMenuItem.Visible = True RenomerLeFichierToolStripMenuItem1.Visible = True RenomerLeFichierToolStripMenuItem.Text = "Renomer le fichier: " & ListBox1.SelectedItem RenomerLeFichierToolStripMenuItem1.Text = "Renomer le fichier: " & ListBox1.SelectedItem ElseIf ListBox1.SelectedItem.ToString.Contains(".") Then SupprimerLeFichierSelectionnerToolStripMenuItem2.Visible = True SupprimerLeDossierEtSontContenuSelectionnezToolStripMenuItem1.Visible = False SupprimerLeFichierSelectionnerToolStripMenuItem1.Visible = True SupprimerLeDossierEtSontContenuSelectionnezToolStripMenuItem.Visible = False LireLeFichierSelectionnerToolStripMenuItem2.Visible = True LireLeFichierSelectionnerToolStripMenuItem1.Visible = True TéléchargerLeFichierSelectionnerToolStripMenuItem1.Visible = True TéléchargerLeFichierSelectionnerToolStripMenuItem2.Visible = True PartagerLeFichierSelectionnerAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem2.Visible = True PartagerLeFichierSelectionnerAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem1.Visible = True CréerUnQRCodelientPourAccéterAuFichierToolStripMenuItem1.Visible = True CréerUnQRCodelientPourAccéterAuFichierToolStripMenuItem2.Visible = True LireLeFichierSelectionnerToolStripMenuItem1.Text = "Lire le fichier: " & ListBox1.SelectedItem LireLeFichierSelectionnerToolStripMenuItem2.Text = "Lire le fichier: " & ListBox1.SelectedItem SupprimerLeFichierSelectionnerToolStripMenuItem1.Text = "Supprimer le fichier: " & ListBox1.SelectedItem SupprimerLeFichierSelectionnerToolStripMenuItem2.Text = "Supprimer le fichier: " & ListBox1.SelectedItem PartagerLeFichierSelectionnerAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem1.Text = "Copier le fichier: " & ListBox1.SelectedItem & " avec un autre utilisateur de lecteur média" PartagerLeFichierSelectionnerAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem2.Text = "Copier le fichier: " & ListBox1.SelectedItem & " avec un autre utilisateur de lecteur média" ParterLeFichierAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem.Visible = True ParterLeFichierAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem1.Visible = True ParterLeFichierAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem.Text = "Partager le fichier: " & ListBox1.SelectedItem & " avec un autre utilisateur de lecteur média" ParterLeFichierAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem1.Text = "Partager le fichier: " & ListBox1.SelectedItem & " avec un autre utilisateur de lecteur média" TéléchargerLeFichierSelectionnerToolStripMenuItem1.Text = "Télécharger le fichier: " & ListBox1.SelectedItem TéléchargerLeFichierSelectionnerToolStripMenuItem2.Text = "Télécharger le fichier: " & ListBox1.SelectedItem DéplacerVersToolStripMenuItem.Visible = True DéplacerVersToolStripMenuItem1.Visible = True DéplacerVersToolStripMenuItem.Text = "Déplacer: " & ListBox1.SelectedItem & " vers" DéplacerVersToolStripMenuItem1.Text = "Déplacer: " & ListBox1.SelectedItem & " vers" RenomerLeFichierToolStripMenuItem.Visible = True RenomerLeFichierToolStripMenuItem1.Visible = True RenomerLeFichierToolStripMenuItem.Text = "Renommer le fichier: " & ListBox1.SelectedItem RenomerLeFichierToolStripMenuItem1.Text = "Renommer le fichier: " & ListBox1.SelectedItem Else SupprimerLeFichierSelectionnerToolStripMenuItem2.Visible = False SupprimerLeDossierEtSontContenuSelectionnezToolStripMenuItem1.Visible = True SupprimerLeFichierSelectionnerToolStripMenuItem1.Visible = False SupprimerLeDossierEtSontContenuSelectionnezToolStripMenuItem.Visible = True LireLeFichierSelectionnerToolStripMenuItem2.Visible = False LireLeFichierSelectionnerToolStripMenuItem1.Visible = False TéléchargerLeFichierSelectionnerToolStripMenuItem1.Visible = False TéléchargerLeFichierSelectionnerToolStripMenuItem2.Visible = False CréerUnQRCodelientPourAccéterAuFichierToolStripMenuItem1.Visible = True CréerUnQRCodelientPourAccéterAuFichierToolStripMenuItem2.Visible = True ParterLeFichierAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem.Visible = False ParterLeFichierAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem1.Visible = False PartagerLeFichierSelectionnerAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem1.Visible = False PartagerLeFichierSelectionnerAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem2.Visible = False DéplacerVersToolStripMenuItem.Visible = False DéplacerVersToolStripMenuItem1.Visible = False RenomerLeFichierToolStripMenuItem.Visible = True RenomerLeFichierToolStripMenuItem1.Visible = True RenomerLeFichierToolStripMenuItem.Text = "Renommer le dossier: " & ListBox1.SelectedItem RenomerLeFichierToolStripMenuItem1.Text = "Renommer le dossier: " & ListBox1.SelectedItem End If End Sub Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick Timer1.Stop() ListBox2.Items.Clear() Try Dim fwr As FtpWebRequest fwr = FtpWebRequest.Create(ipserver & "/" & "Utilisateur" & "/" & tcon & "/" & "Dirve" & "/" & ListBox1.SelectedItem & "/") 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() listb2ab = ListBox2.Items.Count ListBox2.SetSelected(0, True) For x = 1 To ListBox2.Items.Count Dim ftreq2 As FtpWebRequest = FtpWebRequest.Create(ipserver & "/Utilisateur/" & tcon & "/Dirve/" & ListBox1.SelectedItem & "/" & ListBox2.SelectedItem) ftreq2.Method = WebRequestMethods.Ftp.DeleteFile ftreq2.Credentials = New NetworkCredential("yoannsafe", passftp) Dim ftpresp2 As FtpWebResponse = ftreq2.GetResponse listb2ab = listb2ab - 1 ListBox2.SetSelected(listb2ab, True) Next deldossier2() Catch ex As Exception Timer1.Start() End Try End Sub Private Sub DéplacerVersToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DéplacerVersToolStripMenuItem.Click drive9.fonction = 0 drive9.ShowDialog() End Sub Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged End Sub Private Sub ContextMenuStrip2_Opening(sender As Object, e As CancelEventArgs) Handles ContextMenuStrip2.Opening If ListBox4.SelectedItem = "" Then e.Cancel = True Else End If End Sub Private Sub RefuserToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles RefuserToolStripMenuItem.Click If ListBox4.SelectedItem.ToString.EndsWith(".plm") Then Dim ftreq As FtpWebRequest = FtpWebRequest.Create(ipserver & "/Utilisateur/" & tcon & "/driveattfile/" & ListBox4.SelectedItem.ToString.Replace(".plm", "") & ".txt") ftreq.Method = WebRequestMethods.Ftp.DeleteFile ftreq.Credentials = New NetworkCredential("yoannsafe", passftp) Dim ftpresp As FtpWebResponse = ftreq.GetResponse Else Dim ftreq As FtpWebRequest = FtpWebRequest.Create(ipserver & "/Utilisateur/" & tcon & "/driveattfile/" & ListBox4.SelectedItem) ftreq.Method = WebRequestMethods.Ftp.DeleteFile ftreq.Credentials = New NetworkCredential("yoannsafe", passftp) Dim ftpresp As FtpWebResponse = ftreq.GetResponse End If MsgBox("La demande: " & ListBox4.SelectedItem & " a bien été Refuser", MsgBoxStyle.Information) ListBox4.Items.Clear() ftp() End Sub Private Sub AccpterToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AccpterToolStripMenuItem.Click If ListBox4.SelectedItem.ToString.EndsWith(".plm") Then Dim ftreq As FtpWebRequest = FtpWebRequest.Create(ipserver & "/Utilisateur/" & tcon & "/driveattfile/" & ListBox4.SelectedItem.ToString.Replace(".plm", "") & ".txt") ftreq.Method = WebRequestMethods.Ftp.Rename ftreq.RenameTo = "/Utilisateur/" & tcon & "/Dirve/" & ListBox4.SelectedItem.ToString.Replace(".plm", "") & ".txt" ftreq.Credentials = New NetworkCredential("yoannsafe", passftp) Dim ftpresp As FtpWebResponse = ftreq.GetResponse MsgBox("Le fichier: " & ListBox4.SelectedItem & " est maintenant disponible dans vos fichier", MsgBoxStyle.Information) ftp() Else Dim ftreq As FtpWebRequest = FtpWebRequest.Create(ipserver & "/Utilisateur/" & tcon & "/driveattfile/" & ListBox4.SelectedItem) ftreq.Method = WebRequestMethods.Ftp.Rename ftreq.RenameTo = "/Utilisateur/" & tcon & "/dirve/" & ListBox4.SelectedItem & "/" ftreq.Credentials = New NetworkCredential("yoannsafe", passftp) Dim ftpresp As FtpWebResponse = ftreq.GetResponse MsgBox("Le fichier: " & ListBox4.SelectedItem & " est maintenant disponible dans vos fichier", MsgBoxStyle.Information) ftp() End If End Sub Private Sub ParterLeFichierAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ParterLeFichierAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem.Click drive8.ShowDialog() End Sub Private Sub ParterLeFichierAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles ParterLeFichierAvecUnAutreUtilisateurDeLecteurMédiaToolStripMenuItem1.Click drive8.ShowDialog() End Sub Private Sub DéplacerVersToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles DéplacerVersToolStripMenuItem1.Click drive9.fonction = 0 drive9.ShowDialog() End Sub Private Sub RenomerLeFichierToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles RenomerLeFichierToolStripMenuItem.Click If RenomerLeFichierToolStripMenuItem.Text.Contains("dossier") Then drive9.fonction = 2 drive9.ShowDialog() Else drive9.fonction = 1 drive9.ShowDialog() End If End Sub Private Sub RenomerLeFichierToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles RenomerLeFichierToolStripMenuItem1.Click If RenomerLeFichierToolStripMenuItem.Text.Contains("dossier") Then drive9.fonction = 2 drive9.ShowDialog() Else drive9.fonction = 1 drive9.ShowDialog() End If End Sub End Class