901 lines
39 KiB
VB.net
901 lines
39 KiB
VB.net
Imports System.ComponentModel
|
|
Imports System.IO
|
|
Imports System.Net
|
|
|
|
Public Class Form22
|
|
Dim téléchargement As Integer = 0
|
|
Dim nomtlfile As String = ""
|
|
Private Sub Form22_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
|
Try
|
|
Dim fwr As FtpWebRequest
|
|
fwr = FtpWebRequest.Create(ipserver & "utilisateur/" & nomutilisateur & "/liste/")
|
|
fwr.Credentials = New NetworkCredential("extremedownloaders", 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()
|
|
|
|
If ComboBox1.Items.Count = 0 Then
|
|
MsgBox("aucune liste trouvez", MsgBoxStyle.Critical)
|
|
Close()
|
|
Else
|
|
ComboBox1.SelectedIndex = 0
|
|
End If
|
|
|
|
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
|
|
Dim fwr As FtpWebRequest
|
|
fwr = FtpWebRequest.Create(ipserver & "utilisateur/" & nomutilisateur & "/liste/")
|
|
fwr.Credentials = New NetworkCredential("extremedownloaders", 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()
|
|
|
|
If ComboBox1.Items.Count = 0 Then
|
|
MsgBox("aucune liste trouvez", MsgBoxStyle.Critical)
|
|
Close()
|
|
Else
|
|
ComboBox1.SelectedIndex = 0
|
|
End If
|
|
|
|
Catch ex As Exception
|
|
Timer1.Start()
|
|
End Try
|
|
End Sub
|
|
Private Sub ComboBox1_SelectedValueChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedValueChanged
|
|
Button1.Text = "ajoutter a: " & ComboBox1.SelectedItem
|
|
End Sub
|
|
|
|
Private Sub Form22_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
|
|
If téléchargement = 1 Then
|
|
e.Cancel = True
|
|
MsgBox("a mis sur votre liste est en cours" & vbNewLine & "merci de patienter", MsgBoxStyle.Exclamation)
|
|
Else
|
|
ComboBox1.Items.Clear()
|
|
ComboBox1.Show()
|
|
Button1.Show()
|
|
nomtlfile = ""
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
|
If Form5.dl = 0 And Form5.nom.Contains(".zip") = True Then
|
|
Form3.ListBox1.SelectedItem.ToString()
|
|
vérifidos1()
|
|
ElseIf Form5.dl = 0 And Form5.nom.Contains(".exe") = True Then
|
|
Form3.ListBox1.SelectedItem.ToString()
|
|
vérifidos1()
|
|
ElseIf Form5.dl = 0 And Form5.nom.Contains(".jar") = True Then
|
|
Form3.ListBox1.SelectedItem.ToString()
|
|
vérifidos1()
|
|
ElseIf Form5.dl = 1 And Form5.nom.Contains(".zip") = True Then
|
|
Form3.ListBox2.SelectedItem.ToString()
|
|
vérifidos2()
|
|
ElseIf Form5.dl = 1 And Form5.nom.Contains(".jar") = True Then
|
|
Form3.ListBox2.SelectedItem.ToString()
|
|
vérifidos2()
|
|
ElseIf Form5.dl = 1 And Form5.nom.Contains(".exe") = True Then
|
|
Form3.ListBox2.SelectedItem.ToString()
|
|
vérifidos2()
|
|
ElseIf Form5.dl = 2 Then
|
|
Form3.ListBox3.SelectedItem.ToString()
|
|
vérifidos3()
|
|
ElseIf Form5.dl = 3 Then
|
|
Form3.ListBox4.SelectedItem.ToString()
|
|
vérifidos4()
|
|
ElseIf Form5.dl = 4 Then
|
|
Form3.ListBox5.SelectedItem.ToString()
|
|
vérifidos5()
|
|
ElseIf Form5.dl = 5 Then
|
|
Form3.ListBox6.SelectedItem.ToString()
|
|
vérifidos6()
|
|
ElseIf Form5.dl = 6 Then
|
|
Form3.ListBox7.SelectedItem.ToString()
|
|
vérifidos7()
|
|
ElseIf Form5.dl = 7 Then
|
|
Form3.ListBox8.SelectedItem.ToString()
|
|
vérifidos8()
|
|
End If
|
|
End Sub
|
|
Sub vérifidos1()
|
|
Try
|
|
ListBox1.Items.Clear()
|
|
Dim fwr As FtpWebRequest
|
|
fwr = FtpWebRequest.Create(ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/")
|
|
fwr.Credentials = New NetworkCredential("extremedownloaders", 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(dostemps & str)
|
|
|
|
|
|
str = sr.ReadLine()
|
|
|
|
End While
|
|
sr.Close()
|
|
|
|
If Directory.Exists(dostemps & Form3.ListBox1.SelectedItem) = True Then
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
MsgBox("Le fichier: " & Form3.ListBox1.SelectedItem & " est dêja présent dans la liste: " & ComboBox1.SelectedItem, MsgBoxStyle.Exclamation)
|
|
Close()
|
|
Else
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
dlfichier()
|
|
End If
|
|
|
|
Catch ex As Exception
|
|
Timer2.Start()
|
|
End Try
|
|
End Sub
|
|
|
|
Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
|
|
Timer2.Stop()
|
|
Try
|
|
ListBox1.Items.Clear()
|
|
Dim fwr As FtpWebRequest
|
|
fwr = FtpWebRequest.Create(ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/")
|
|
fwr.Credentials = New NetworkCredential("extremedownloaders", 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(dostemps & str)
|
|
|
|
|
|
str = sr.ReadLine()
|
|
|
|
End While
|
|
sr.Close()
|
|
|
|
If Directory.Exists(dostemps & Form3.ListBox1.SelectedItem) = True Then
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
|
|
MsgBox("Le fichier: " & Form3.ListBox1.SelectedItem & " est dêja présent dans la liste: " & ComboBox1.SelectedItem, MsgBoxStyle.Exclamation)
|
|
Close()
|
|
Else
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
dlfichier()
|
|
End If
|
|
|
|
Catch ex As Exception
|
|
Timer2.Start()
|
|
End Try
|
|
End Sub
|
|
Sub dlfichier()
|
|
Try
|
|
Dim MaRequete As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create(ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/" & Form5.Text & "/"), System.Net.FtpWebRequest)
|
|
Dim ftpStream As Stream = Nothing
|
|
|
|
MaRequete.Credentials = New System.Net.NetworkCredential("extremedownloaders", passftp)
|
|
MaRequete.Method = System.Net.WebRequestMethods.Ftp.MakeDirectory
|
|
|
|
Dim response As FtpWebResponse = CType(MaRequete.GetResponse, FtpWebResponse)
|
|
ftpStream = response.GetResponseStream
|
|
ftpStream.Close()
|
|
response.Close()
|
|
|
|
dlfichier2()
|
|
Catch ex As Exception
|
|
Timer12.Start()
|
|
End Try
|
|
End Sub
|
|
Sub dlfichier2()
|
|
ComboBox1.Hide()
|
|
Button1.Hide()
|
|
If Form5.dl = 0 And Form5.nom.Contains(".zip") = True Then
|
|
Dim sw1 As New StreamWriter(dostemps & "\download.txt")
|
|
sw1.WriteLine(ipsite & "extrème downloaders/Téléchargeur/logiciels/" & Form3.ListBox1.SelectedItem.ToString & "/" & Form5.nom)
|
|
sw1.Close()
|
|
My.Computer.Network.UploadFile(dostemps & "\download.txt", ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/" & Form5.Text & "/download.txt")
|
|
File.Delete(dostemps & "\download.txt")
|
|
MsgBox(Form5.nom & " a bien êtê ajoutter a la liste: " & ComboBox1.SelectedItem, MsgBoxStyle.Information)
|
|
Close()
|
|
ElseIf Form5.dl = 0 And Form5.nom.Contains(".exe") = True Then
|
|
Dim sw1 As New StreamWriter(dostemps & "\download.txt")
|
|
sw1.WriteLine(ipsite & "extrème downloaders/Téléchargeur/logiciels/" & Form3.ListBox1.SelectedItem.ToString & "/" & Form3.ListBox1.SelectedItem.ToString & " setup.exe")
|
|
sw1.Close()
|
|
My.Computer.Network.UploadFile(dostemps & "\download.txt", ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/" & Form5.Text & "/download.txt")
|
|
File.Delete(dostemps & "\download.txt")
|
|
MsgBox(Form5.nom & " a bien êtê ajoutter a la liste: " & ComboBox1.SelectedItem, MsgBoxStyle.Information)
|
|
Close()
|
|
ElseIf Form5.dl = 0 And Form5.nom.Contains(".jar") = True Then
|
|
Dim sw1 As New StreamWriter(dostemps & "\download.txt")
|
|
sw1.WriteLine(ipsite & "extrème downloaders/Téléchargeur/logiciels/" & Form3.ListBox1.SelectedItem.ToString & "/" & Form5.nom)
|
|
sw1.Close()
|
|
My.Computer.Network.UploadFile(dostemps & "\download.txt", ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/" & Form5.Text & "/download.txt")
|
|
File.Delete(dostemps & "\download.txt")
|
|
MsgBox(Form5.nom & " a bien êtê ajoutter a la liste: " & ComboBox1.SelectedItem, MsgBoxStyle.Information)
|
|
Close()
|
|
ElseIf Form5.dl = 1 And Form5.nom.Contains(".zip") = True Then
|
|
Dim sw1 As New StreamWriter(dostemps & "\download.txt")
|
|
sw1.WriteLine(ipsite & "extrème downloaders/Téléchargeur/jeux/Tout les jeux/" & Form3.ListBox2.SelectedItem.ToString & "/" & Form5.nom)
|
|
sw1.Close()
|
|
My.Computer.Network.UploadFile(dostemps & "\download.txt", ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/" & Form5.Text & "/download.txt")
|
|
File.Delete(dostemps & "\download.txt")
|
|
MsgBox(Form5.nom & " a bien êtê ajoutter a la liste: " & ComboBox1.SelectedItem, MsgBoxStyle.Information)
|
|
Close()
|
|
ElseIf Form5.dl = 1 And Form5.nom.Contains(".jar") = True Then
|
|
Dim sw1 As New StreamWriter(dostemps & "\download.txt")
|
|
sw1.WriteLine(ipsite & "extrème downloaders/Téléchargeur/jeux/Tout les jeux/" & Form3.ListBox2.SelectedItem.ToString & "/" & Form5.nom)
|
|
sw1.Close()
|
|
My.Computer.Network.UploadFile(dostemps & "\download.txt", ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/" & Form5.Text & "/download.txt")
|
|
File.Delete(dostemps & "\download.txt")
|
|
MsgBox(Form5.nom & " a bien êtê ajoutter a la liste: " & ComboBox1.SelectedItem, MsgBoxStyle.Information)
|
|
Close()
|
|
ElseIf Form5.dl = 1 And Form5.nom.Contains(".exe") = True Then
|
|
Dim sw1 As New StreamWriter(dostemps & "\download.txt")
|
|
sw1.WriteLine(ipsite & "extrème downloaders/Téléchargeur/jeux/Tout les jeux/" & Form3.ListBox2.SelectedItem.ToString & "/" & Form5.nom)
|
|
sw1.Close()
|
|
My.Computer.Network.UploadFile(dostemps & "\download.txt", ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/" & Form5.Text & "/download.txt")
|
|
File.Delete(dostemps & "\download.txt")
|
|
MsgBox(Form5.nom & " a bien êtê ajoutter a la liste: " & ComboBox1.SelectedItem, MsgBoxStyle.Information)
|
|
Close()
|
|
ElseIf Form5.dl = 2 Then
|
|
Dim sw1 As New StreamWriter(dostemps & "\download.txt")
|
|
sw1.WriteLine(ipsite & "extrème downloaders/Téléchargeur/ISO/" & Form3.ComboBox3.SelectedItem.ToString & "/" & Form3.ListBox3.SelectedItem.ToString & "/" & Form3.ListBox3.SelectedItem.ToString & ".iso")
|
|
sw1.Close()
|
|
My.Computer.Network.UploadFile(dostemps & "\download.txt", ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/" & Form5.Text & "/download.txt")
|
|
File.Delete(dostemps & "\download.txt")
|
|
MsgBox(Form5.nom & " a bien êtê ajoutter a la liste: " & ComboBox1.SelectedItem, MsgBoxStyle.Information)
|
|
Close()
|
|
ElseIf Form5.dl = 3 Then
|
|
Dim sw1 As New StreamWriter(dostemps & "\download.txt")
|
|
sw1.WriteLine(ipsite & "extrème downloaders/Téléchargeur/jeux/minecraft/mod/" & Form3.ComboBox4.SelectedItem.ToString & "/" & Form3.ListBox4.SelectedItem.ToString & "/" & Form3.ListBox4.SelectedItem.ToString & ".zip")
|
|
sw1.Close()
|
|
My.Computer.Network.UploadFile(dostemps & "\download.txt", ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/" & Form5.Text & "/download.txt")
|
|
File.Delete(dostemps & "\download.txt")
|
|
MsgBox(Form5.nom & " a bien êtê ajoutter a la liste: " & ComboBox1.SelectedItem, MsgBoxStyle.Information)
|
|
Close()
|
|
ElseIf Form5.dl = 4 Then
|
|
Dim sw1 As New StreamWriter(dostemps & "\download.txt")
|
|
sw1.WriteLine(ipsite & "extrème downloaders/Téléchargeur/jeux/minecraft/plugin/" & Form3.ComboBox5.SelectedItem.ToString & "/" & Form3.ListBox5.SelectedItem.ToString & "/" & Form3.ListBox5.SelectedItem.ToString & ".zip")
|
|
sw1.Close()
|
|
My.Computer.Network.UploadFile(dostemps & "\download.txt", ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/" & Form5.Text & "/download.txt")
|
|
File.Delete(dostemps & "\download.txt")
|
|
MsgBox(Form5.nom & " a bien êtê ajoutter a la liste: " & ComboBox1.SelectedItem, MsgBoxStyle.Information)
|
|
Close()
|
|
ElseIf Form5.dl = 5 Then
|
|
Dim sw1 As New StreamWriter(dostemps & "\download.txt")
|
|
sw1.WriteLine(ipsite & "extrème downloaders/Téléchargeur/jeux/minecraft/map/" & Form3.ComboBox6.SelectedItem.ToString & "/" & Form3.ListBox6.SelectedItem.ToString & "/" & Form3.ListBox6.SelectedItem.ToString & ".zip")
|
|
sw1.Close()
|
|
My.Computer.Network.UploadFile(dostemps & "\download.txt", ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/" & Form5.Text & "/download.txt")
|
|
File.Delete(dostemps & "\download.txt")
|
|
MsgBox(Form5.nom & " a bien êtê ajoutter a la liste: " & ComboBox1.SelectedItem, MsgBoxStyle.Information)
|
|
Close()
|
|
ElseIf Form5.dl = 6 Then
|
|
Dim sw1 As New StreamWriter(dostemps & "\download.txt")
|
|
sw1.WriteLine(ipsite & "extrème downloaders/Téléchargeur/jeux/minecraft/serveur/" & Form3.ComboBox7.SelectedItem.ToString & "/" & Form3.ListBox7.SelectedItem.ToString & "/" & Form3.ListBox7.SelectedItem.ToString & ".zip")
|
|
sw1.Close()
|
|
My.Computer.Network.UploadFile(dostemps & "\download.txt", ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/" & Form5.Text & "/download.txt")
|
|
File.Delete(dostemps & "\download.txt")
|
|
MsgBox(Form5.nom & " a bien êtê ajoutter a la liste: " & ComboBox1.SelectedItem, MsgBoxStyle.Information)
|
|
Close()
|
|
ElseIf Form5.dl = 7 Then
|
|
Dim sw1 As New StreamWriter(dostemps & "\download.txt")
|
|
sw1.WriteLine(ipsite & "extrème downloaders/Téléchargeur/jeux/minecraft/Launcher/" & Form3.ListBox8.SelectedItem.ToString & "/" & Form3.ListBox8.SelectedItem.ToString & ".zip")
|
|
sw1.Close()
|
|
My.Computer.Network.UploadFile(dostemps & "\download.txt", ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/" & Form5.Text & "/download.txt")
|
|
File.Delete(dostemps & "\download.txt")
|
|
MsgBox(Form5.nom & " a bien êtê ajoutter a la liste: " & ComboBox1.SelectedItem, MsgBoxStyle.Information)
|
|
Close()
|
|
End If
|
|
End Sub
|
|
Sub vérifidos2()
|
|
Try
|
|
ListBox1.Items.Clear()
|
|
Dim fwr As FtpWebRequest
|
|
fwr = FtpWebRequest.Create(ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/")
|
|
fwr.Credentials = New NetworkCredential("extremedownloaders", 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(dostemps & str)
|
|
|
|
|
|
str = sr.ReadLine()
|
|
|
|
End While
|
|
sr.Close()
|
|
|
|
If Directory.Exists(dostemps & Form3.ListBox2.SelectedItem) = True Then
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
MsgBox("Le fichier: " & Form3.ListBox2.SelectedItem & " est dêja présent dans la liste: " & ComboBox1.SelectedItem, MsgBoxStyle.Exclamation)
|
|
Close()
|
|
Else
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
dlfichier()
|
|
End If
|
|
|
|
Catch ex As Exception
|
|
Timer3.Start()
|
|
End Try
|
|
End Sub
|
|
|
|
Private Sub Timer3_Tick(sender As Object, e As EventArgs) Handles Timer3.Tick
|
|
Timer3.Stop()
|
|
Try
|
|
ListBox1.Items.Clear()
|
|
Dim fwr As FtpWebRequest
|
|
fwr = FtpWebRequest.Create(ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/")
|
|
fwr.Credentials = New NetworkCredential("extremedownloaders", 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(dostemps & str)
|
|
|
|
|
|
str = sr.ReadLine()
|
|
|
|
End While
|
|
sr.Close()
|
|
|
|
If Directory.Exists(dostemps & Form3.ListBox2.SelectedItem) = True Then
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
MsgBox("Le fichier: " & Form3.ListBox2.SelectedItem & " est dêja présent dans la liste: " & ComboBox1.SelectedItem, MsgBoxStyle.Exclamation)
|
|
Close()
|
|
Else
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
dlfichier()
|
|
End If
|
|
|
|
Catch ex As Exception
|
|
Timer3.Start()
|
|
End Try
|
|
End Sub
|
|
Sub vérifidos3()
|
|
Try
|
|
ListBox1.Items.Clear()
|
|
Dim fwr As FtpWebRequest
|
|
fwr = FtpWebRequest.Create(ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/")
|
|
fwr.Credentials = New NetworkCredential("extremedownloaders", 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(dostemps & str)
|
|
|
|
|
|
str = sr.ReadLine()
|
|
|
|
End While
|
|
sr.Close()
|
|
|
|
If Directory.Exists(dostemps & Form3.ListBox3.SelectedItem) = True Then
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
MsgBox("Le fichier: " & Form3.ListBox3.SelectedItem & " est dêja présent dans la liste: " & ComboBox1.SelectedItem, MsgBoxStyle.Exclamation)
|
|
Close()
|
|
Else
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
dlfichier()
|
|
End If
|
|
|
|
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
|
|
ListBox1.Items.Clear()
|
|
Dim fwr As FtpWebRequest
|
|
fwr = FtpWebRequest.Create(ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/")
|
|
fwr.Credentials = New NetworkCredential("extremedownloaders", 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(dostemps & str)
|
|
|
|
|
|
str = sr.ReadLine()
|
|
|
|
End While
|
|
sr.Close()
|
|
|
|
If Directory.Exists(dostemps & Form3.ListBox3.SelectedItem) = True Then
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
MsgBox("Le fichier: " & Form3.ListBox3.SelectedItem & " est dêja présent dans la liste: " & ComboBox1.SelectedItem, MsgBoxStyle.Exclamation)
|
|
Close()
|
|
Else
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
dlfichier()
|
|
End If
|
|
|
|
Catch ex As Exception
|
|
Timer4.Start()
|
|
End Try
|
|
End Sub
|
|
Sub vérifidos4()
|
|
Try
|
|
ListBox1.Items.Clear()
|
|
Dim fwr As FtpWebRequest
|
|
fwr = FtpWebRequest.Create(ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/")
|
|
fwr.Credentials = New NetworkCredential("extremedownloaders", 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(dostemps & str)
|
|
|
|
|
|
str = sr.ReadLine()
|
|
|
|
End While
|
|
sr.Close()
|
|
|
|
If Directory.Exists(dostemps & Form3.ListBox4.SelectedItem) = True Then
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
MsgBox("Le fichier: " & Form3.ListBox4.SelectedItem & " est dêja présent dans la liste: " & ComboBox1.SelectedItem, MsgBoxStyle.Exclamation)
|
|
Close()
|
|
Else
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
dlfichier()
|
|
End If
|
|
|
|
Catch ex As Exception
|
|
Timer5.Start()
|
|
End Try
|
|
End Sub
|
|
|
|
Private Sub Timer5_Tick(sender As Object, e As EventArgs) Handles Timer5.Tick
|
|
Timer5.Stop()
|
|
Try
|
|
ListBox1.Items.Clear()
|
|
Dim fwr As FtpWebRequest
|
|
fwr = FtpWebRequest.Create(ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/")
|
|
fwr.Credentials = New NetworkCredential("extremedownloaders", 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(dostemps & str)
|
|
|
|
|
|
str = sr.ReadLine()
|
|
|
|
End While
|
|
sr.Close()
|
|
|
|
If Directory.Exists(dostemps & Form3.ListBox4.SelectedItem) = True Then
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
MsgBox("Le fichier: " & Form3.ListBox4.SelectedItem & " est dêja présent dans la liste: " & ComboBox1.SelectedItem, MsgBoxStyle.Exclamation)
|
|
Close()
|
|
Else
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
dlfichier()
|
|
End If
|
|
|
|
Catch ex As Exception
|
|
Timer5.Start()
|
|
End Try
|
|
End Sub
|
|
Sub vérifidos5()
|
|
Try
|
|
ListBox1.Items.Clear()
|
|
Dim fwr As FtpWebRequest
|
|
fwr = FtpWebRequest.Create(ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/")
|
|
fwr.Credentials = New NetworkCredential("extremedownloaders", 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(dostemps & str)
|
|
|
|
|
|
str = sr.ReadLine()
|
|
|
|
End While
|
|
sr.Close()
|
|
|
|
If Directory.Exists(dostemps & Form3.ListBox5.SelectedItem) = True Then
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
MsgBox("Le fichier: " & Form3.ListBox5.SelectedItem & " est dêja présent dans la liste: " & ComboBox1.SelectedItem, MsgBoxStyle.Exclamation)
|
|
Close()
|
|
Else
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
dlfichier()
|
|
End If
|
|
|
|
Catch ex As Exception
|
|
Timer6.Start()
|
|
End Try
|
|
End Sub
|
|
|
|
Private Sub Timer6_Tick(sender As Object, e As EventArgs) Handles Timer6.Tick
|
|
Timer6.Stop()
|
|
Try
|
|
ListBox1.Items.Clear()
|
|
Dim fwr As FtpWebRequest
|
|
fwr = FtpWebRequest.Create(ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/")
|
|
fwr.Credentials = New NetworkCredential("extremedownloaders", 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(dostemps & str)
|
|
|
|
|
|
str = sr.ReadLine()
|
|
|
|
End While
|
|
sr.Close()
|
|
|
|
If Directory.Exists(dostemps & Form3.ListBox5.SelectedItem) = True Then
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
MsgBox("Le fichier: " & Form3.ListBox5.SelectedItem & " est dêja présent dans la liste: " & ComboBox1.SelectedItem, MsgBoxStyle.Exclamation)
|
|
Close()
|
|
Else
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
dlfichier()
|
|
End If
|
|
|
|
Catch ex As Exception
|
|
Timer6.Start()
|
|
End Try
|
|
End Sub
|
|
Sub vérifidos6()
|
|
Try
|
|
ListBox1.Items.Clear()
|
|
Dim fwr As FtpWebRequest
|
|
fwr = FtpWebRequest.Create(ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/")
|
|
fwr.Credentials = New NetworkCredential("extremedownloaders", 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(dostemps & str)
|
|
|
|
|
|
str = sr.ReadLine()
|
|
|
|
End While
|
|
sr.Close()
|
|
|
|
If Directory.Exists(dostemps & Form3.ListBox6.SelectedItem) = True Then
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
MsgBox("Le fichier: " & Form3.ListBox6.SelectedItem & " est dêja présent dans la liste: " & ComboBox1.SelectedItem, MsgBoxStyle.Exclamation)
|
|
Close()
|
|
Else
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
dlfichier()
|
|
End If
|
|
|
|
Catch ex As Exception
|
|
Timer7.Start()
|
|
End Try
|
|
End Sub
|
|
|
|
Private Sub Timer7_Tick(sender As Object, e As EventArgs) Handles Timer7.Tick
|
|
Timer7.Stop()
|
|
Try
|
|
ListBox1.Items.Clear()
|
|
Dim fwr As FtpWebRequest
|
|
fwr = FtpWebRequest.Create(ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/")
|
|
fwr.Credentials = New NetworkCredential("extremedownloaders", 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(dostemps & str)
|
|
|
|
|
|
str = sr.ReadLine()
|
|
|
|
End While
|
|
sr.Close()
|
|
|
|
If Directory.Exists(dostemps & Form3.ListBox6.SelectedItem) = True Then
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
MsgBox("Le fichier: " & Form3.ListBox6.SelectedItem & " est dêja présent dans la liste: " & ComboBox1.SelectedItem, MsgBoxStyle.Exclamation)
|
|
Close()
|
|
Else
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
dlfichier()
|
|
End If
|
|
|
|
Catch ex As Exception
|
|
Timer7.Start()
|
|
End Try
|
|
End Sub
|
|
Sub vérifidos7()
|
|
Try
|
|
ListBox1.Items.Clear()
|
|
Dim fwr As FtpWebRequest
|
|
fwr = FtpWebRequest.Create(ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/")
|
|
fwr.Credentials = New NetworkCredential("extremedownloaders", 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(dostemps & str)
|
|
|
|
|
|
str = sr.ReadLine()
|
|
|
|
End While
|
|
sr.Close()
|
|
|
|
If Directory.Exists(dostemps & Form3.ListBox7.SelectedItem) = True Then
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
MsgBox("Le fichier: " & Form3.ListBox7.SelectedItem & " est dêja présent dans la liste: " & ComboBox1.SelectedItem, MsgBoxStyle.Exclamation)
|
|
Close()
|
|
Else
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
dlfichier()
|
|
End If
|
|
|
|
Catch ex As Exception
|
|
Timer8.Start()
|
|
End Try
|
|
End Sub
|
|
|
|
Private Sub Timer8_Tick(sender As Object, e As EventArgs) Handles Timer8.Tick
|
|
Timer8.Stop()
|
|
Try
|
|
ListBox1.Items.Clear()
|
|
Dim fwr As FtpWebRequest
|
|
fwr = FtpWebRequest.Create(ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/")
|
|
fwr.Credentials = New NetworkCredential("extremedownloaders", 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(dostemps & str)
|
|
|
|
|
|
str = sr.ReadLine()
|
|
|
|
End While
|
|
sr.Close()
|
|
|
|
If Directory.Exists(dostemps & Form3.ListBox7.SelectedItem) = True Then
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
MsgBox("Le fichier: " & Form3.ListBox7.SelectedItem & " est dêja présent dans la liste: " & ComboBox1.SelectedItem, MsgBoxStyle.Exclamation)
|
|
Close()
|
|
Else
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
dlfichier()
|
|
End If
|
|
|
|
Catch ex As Exception
|
|
Timer8.Start()
|
|
End Try
|
|
End Sub
|
|
Sub vérifidos8()
|
|
Try
|
|
ListBox1.Items.Clear()
|
|
Dim fwr As FtpWebRequest
|
|
fwr = FtpWebRequest.Create(ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/")
|
|
fwr.Credentials = New NetworkCredential("extremedownloaders", 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(dostemps & str)
|
|
|
|
|
|
str = sr.ReadLine()
|
|
|
|
End While
|
|
sr.Close()
|
|
|
|
If Directory.Exists(dostemps & Form3.ListBox8.SelectedItem) = True Then
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
MsgBox("Le fichier: " & Form3.ListBox8.SelectedItem & " est dêja présent dans la liste: " & ComboBox1.SelectedItem, MsgBoxStyle.Exclamation)
|
|
Close()
|
|
Else
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
dlfichier()
|
|
End If
|
|
|
|
Catch ex As Exception
|
|
Timer9.Start()
|
|
End Try
|
|
End Sub
|
|
|
|
Private Sub Timer9_Tick(sender As Object, e As EventArgs) Handles Timer9.Tick
|
|
Timer9.Stop()
|
|
Try
|
|
ListBox1.Items.Clear()
|
|
Dim fwr As FtpWebRequest
|
|
fwr = FtpWebRequest.Create(ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/")
|
|
fwr.Credentials = New NetworkCredential("extremedownloaders", 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(dostemps & str)
|
|
|
|
|
|
str = sr.ReadLine()
|
|
|
|
End While
|
|
sr.Close()
|
|
|
|
If Directory.Exists(dostemps & Form3.ListBox8.SelectedItem) = True Then
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
MsgBox("Le fichier: " & Form3.ListBox8.SelectedItem & " est dêja présent dans la liste: " & ComboBox1.SelectedItem, MsgBoxStyle.Exclamation)
|
|
Close()
|
|
Else
|
|
For Each fichier As String In IO.Directory.GetDirectories(dostemps)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Directory.Delete(dostemps & info.Name)
|
|
Next
|
|
dlfichier()
|
|
End If
|
|
|
|
Catch ex As Exception
|
|
Timer9.Start()
|
|
End Try
|
|
End Sub
|
|
|
|
Private Sub Timer12_Tick(sender As Object, e As EventArgs) Handles Timer12.Tick
|
|
Timer12.Stop()
|
|
Try
|
|
Dim MaRequete As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create(ipserver & "utilisateur/" & nomutilisateur & "/liste/" & ComboBox1.SelectedItem & "/" & Form5.Text & "/"), System.Net.FtpWebRequest)
|
|
Dim ftpStream As Stream = Nothing
|
|
|
|
MaRequete.Credentials = New System.Net.NetworkCredential("extremedownloaders", passftp)
|
|
MaRequete.Method = System.Net.WebRequestMethods.Ftp.MakeDirectory
|
|
|
|
Dim response As FtpWebResponse = CType(MaRequete.GetResponse, FtpWebResponse)
|
|
ftpStream = response.GetResponseStream
|
|
ftpStream.Close()
|
|
response.Close()
|
|
|
|
dlfichier2()
|
|
Catch ex As Exception
|
|
Timer12.Start()
|
|
End Try
|
|
End Sub
|
|
End Class |