544 lines
25 KiB
VB.net
544 lines
25 KiB
VB.net
Imports System.ComponentModel
|
|
Imports System.IO
|
|
Imports System.Net
|
|
Imports AxWMPLib
|
|
|
|
Public Class Form150
|
|
Public dl As Integer = 0
|
|
Public up As Integer = 0
|
|
Public utilisateurnom As String = ""
|
|
Private Sub Form150_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
|
AxWindowsMediaPlayer1.Hide()
|
|
|
|
Dim lines1a() As String = File.ReadAllLines(théme)
|
|
|
|
If lines1a(0) = 2 Then
|
|
Me.BackColor = Color.FromArgb(64, 64, 64)
|
|
Label1.ForeColor = Color.White
|
|
Button1.BackColor = Color.FromArgb(64, 64, 64)
|
|
Button1.ForeColor = Color.White
|
|
ListBox1.BackColor = Color.FromArgb(64, 64, 64)
|
|
ListBox1.ForeColor = Color.White
|
|
ListBox2.BackColor = Color.FromArgb(64, 64, 64)
|
|
ListBox2.ForeColor = Color.White
|
|
ListBox3.BackColor = Color.FromArgb(64, 64, 64)
|
|
ListBox3.ForeColor = Color.White
|
|
Label2.ForeColor = Color.White
|
|
Label3.ForeColor = Color.White
|
|
ContextMenuStrip1.BackColor = Color.FromArgb(64, 64, 64)
|
|
ContextMenuStrip1.ForeColor = Color.White
|
|
ContextMenuStrip2.BackColor = Color.FromArgb(64, 64, 64)
|
|
ContextMenuStrip2.ForeColor = Color.White
|
|
ContextMenuStrip3.BackColor = Color.FromArgb(64, 64, 64)
|
|
ContextMenuStrip3.ForeColor = Color.White
|
|
ElseIf lines1a(0) = 3 Then
|
|
TéléchargeLaDictéToolStripMenuItem.Image = Form1.PictureBox10.Image
|
|
LireLaDictéSelectionéToolStripMenuItem.Image = Form1.PictureBox7.Image
|
|
LireLaDisctéSelectionéToolStripMenuItem.Image = Form1.PictureBox7.Image
|
|
PictureBox2.Image = Form1.PictureBox7.Image
|
|
PictureBox3.Image = Form1.PictureBox4.Image
|
|
PictureBox4.Image = Form1.PictureBox5.Image
|
|
GunaMetroTrackBar1.TrackColor = Color.FromArgb(Form1.trackparproA, Form1.trackparproR, Form1.trackparproG, Form1.trackparproB)
|
|
GunaMetroTrackBar1.TrackHoverColor = Color.FromArgb(Form1.trackparproA, Form1.trackparproR, Form1.trackparproG, Form1.trackparproB)
|
|
GunaMetroTrackBar1.TrackPressedColor = Color.FromArgb(Form1.trackparproA, Form1.trackparproR, Form1.trackparproG, Form1.trackparproB)
|
|
GunaMetroTrackBar1.TrackIdleColor = Color.FromArgb(Form1.trackparcolorA, Form1.trackparcolorR, Form1.trackparcolorG, Form1.trackparcolorB)
|
|
Me.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
Label1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
Button1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
Button1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
ListBox1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
ListBox1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
ListBox2.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
ListBox2.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
ListBox3.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
ListBox3.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
Label2.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
Label3.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
ContextMenuStrip1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
ContextMenuStrip1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
ContextMenuStrip2.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
ContextMenuStrip2.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
ContextMenuStrip3.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
ContextMenuStrip3.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
Else
|
|
|
|
End If
|
|
|
|
Dim lines2() As String = File.ReadAllLines(comtpeco2)
|
|
If lines2(0) = 1 Then
|
|
comptelect()
|
|
Form21.TopMost = False
|
|
Else
|
|
TabControl1.TabPages.Remove(TabPage3)
|
|
Form21.TopMost = False
|
|
Label3.Hide()
|
|
ProgressBar1.Hide()
|
|
PictureBox4.Hide()
|
|
PictureBox3.Hide()
|
|
PictureBox2.Hide()
|
|
GunaMetroTrackBar1.Hide()
|
|
Label1.Hide()
|
|
Label2.Hide()
|
|
For Each fichier As String In IO.Directory.GetFiles(discté)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
ListBox2.Items.Add(info.Name)
|
|
Next
|
|
ftp()
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub Form150_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
|
|
If dl = 1 Then
|
|
e.Cancel = True
|
|
MsgBox("Merci de patienter le téléchargement de :" & ListBox1.SelectedItem & " est en cours", MsgBoxStyle.Critical)
|
|
ElseIf up = 1 Then
|
|
e.Cancel = True
|
|
MsgBox("Merci de patienter la mise en ligne de :" & OpenFileDialog1.SafeFileName & " est en cours", MsgBoxStyle.Critical)
|
|
Else
|
|
Dim lines2() As String = File.ReadAllLines(comtpeco2)
|
|
|
|
If lines2(0) = 1 Then
|
|
PictureBox1.Image.Dispose()
|
|
File.Delete(compte & "photo.png")
|
|
End If
|
|
PictureBox3.Hide()
|
|
PictureBox2.Hide()
|
|
GunaMetroTrackBar1.Hide()
|
|
Label1.Hide()
|
|
Label2.Hide()
|
|
AxWindowsMediaPlayer1.Ctlcontrols.stop()
|
|
ListBox1.Items.Clear()
|
|
ListBox2.Items.Clear()
|
|
PictureBox3.Hide()
|
|
PictureBox2.Hide()
|
|
GunaMetroTrackBar1.Hide()
|
|
Label1.Hide()
|
|
Label2.Hide()
|
|
AxWindowsMediaPlayer1.Ctlcontrols.stop()
|
|
ListBox1.Items.Clear()
|
|
ListBox2.Items.Clear()
|
|
PictureBox1.Image.Dispose()
|
|
Form21.TopMost = True
|
|
End If
|
|
End Sub
|
|
Sub ftp()
|
|
Try
|
|
ListBox1.Items.Clear()
|
|
Dim fwr As FtpWebRequest
|
|
fwr = FtpWebRequest.Create(ipserver & "/Dicté/")
|
|
fwr.Credentials = New NetworkCredential("yoannsafe", passftp)
|
|
fwr.Method = WebRequestMethods.Ftp.ListDirectory
|
|
Dim sr As New StreamReader(fwr.GetResponse().GetResponseStream())
|
|
|
|
Dim str As String = sr.ReadLine()
|
|
While Not str Is Nothing
|
|
|
|
ListBox1.Items.Add(str)
|
|
|
|
|
|
str = sr.ReadLine()
|
|
|
|
End While
|
|
|
|
sr.Close()
|
|
Catch ex As Exception
|
|
|
|
End Try
|
|
End Sub
|
|
|
|
Private Sub TéléchargeLaDictéToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles TéléchargeLaDictéToolStripMenuItem.Click
|
|
If ListBox1.SelectedItem = "" Then
|
|
MsgBox("Merci de sélectionner une dictée", MsgBoxStyle.Exclamation)
|
|
Else
|
|
dl = 1
|
|
AxWindowsMediaPlayer1.Ctlcontrols.stop()
|
|
téléchargerfr = New WebClient
|
|
téléchargerfr.DownloadFileTaskAsync(New Uri(ipsite & "/" & "Dicté/" & ListBox1.SelectedItem & "/" & ListBox1.SelectedItem), (discté & "/" & ListBox1.SelectedItem))
|
|
ProgressBar1.Show()
|
|
Label3.Show()
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub téléchargerfr_DownloadFileCompleted(sender As Object, e As AsyncCompletedEventArgs) Handles téléchargerfr.DownloadFileCompleted
|
|
For Each fichier As String In IO.Directory.GetFiles(discté)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Form21.ComboBox1.Items.Remove(info.Name)
|
|
ListBox2.Items.Remove(info.Name)
|
|
Next
|
|
|
|
For Each fichier As String In IO.Directory.GetFiles(discté)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
Form21.ComboBox1.Items.Add(info.Name)
|
|
ListBox2.Items.Add(info.Name)
|
|
Next
|
|
dl = 0
|
|
MsgBox("La dictée: " & ListBox1.SelectedItem & " a bien été télécharger", MsgBoxStyle.Information)
|
|
ProgressBar1.Hide()
|
|
ProgressBar1.Value = 0
|
|
Label3.Hide()
|
|
Label3.Text = ""
|
|
End Sub
|
|
|
|
Dim WithEvents téléchargerfr As WebClient
|
|
Dim WithEvents téléchargerfr2 As WebClient
|
|
|
|
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
|
Dim lines2() As String = File.ReadAllLines(comtpeco2)
|
|
If lines2(0) = 1 Then
|
|
Dim dla As Integer = 1
|
|
If OpenFileDialog1.ShowDialog = 1 Then
|
|
Dim sw1 As New StreamWriter(dictétemp)
|
|
For Each item In ListBox1.Items
|
|
sw1.WriteLine(item)
|
|
Next
|
|
sw1.Close()
|
|
|
|
TextBox1.Text = IO.File.ReadAllText(dictétemp)
|
|
|
|
If TextBox1.Text.Contains(OpenFileDialog1.SafeFileName) Then
|
|
File.Delete(dictétemp)
|
|
MsgBox("La dictée: " & OpenFileDialog1.SafeFileName & " est déjà en ligne, merci de renommer votre fichier", MsgBoxStyle.Exclamation)
|
|
Else
|
|
File.Delete(dictétemp)
|
|
ProgressBar1.Show()
|
|
Label3.Show()
|
|
ListBox1.Items.Clear()
|
|
Try
|
|
up = 1
|
|
Dim MaRequete As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create(ipserver & "/Dicté/" & OpenFileDialog1.SafeFileName & "/"), 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 MaRequete2 As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create(ipserver & "/utilisateur/" & utilisateurnom & "/Dictée/" & OpenFileDialog1.SafeFileName & "/"), System.Net.FtpWebRequest)
|
|
Dim ftpStream2 As Stream = Nothing
|
|
MaRequete2.Credentials = New System.Net.NetworkCredential("yoannsafe", passftp)
|
|
MaRequete2.Method = System.Net.WebRequestMethods.Ftp.MakeDirectory
|
|
Dim response2 As FtpWebResponse = CType(MaRequete2.GetResponse, FtpWebResponse)
|
|
ftpStream2 = response2.GetResponseStream
|
|
ftpStream2.Close()
|
|
response2.Close()
|
|
|
|
|
|
Dim sw2 As New StreamWriter(discté & "\publier.txt")
|
|
sw2.WriteLine(utilisateurnom)
|
|
sw2.Close()
|
|
|
|
My.Computer.Network.UploadFile(discté & "\publier.txt", ipserver & "/Dicté/" & OpenFileDialog1.SafeFileName & "/publier.txt")
|
|
|
|
File.Delete(discté & "\publier.txt")
|
|
|
|
téléchargerfr2 = New WebClient
|
|
téléchargerfr2.UploadFileTaskAsync(ipserver & "/Dicté/" & OpenFileDialog1.SafeFileName & "/" & OpenFileDialog1.SafeFileName, OpenFileDialog1.FileName())
|
|
Catch ex As Exception
|
|
|
|
End Try
|
|
End If
|
|
End If
|
|
Else
|
|
MsgBox("Vous devez être connecter avec un compte lecteur média", MsgBoxStyle.Information)
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub téléchargerfr2_UploadFileCompleted(sender As Object, e As UploadFileCompletedEventArgs) Handles téléchargerfr2.UploadFileCompleted
|
|
Label3.Hide()
|
|
ProgressBar1.Hide()
|
|
Label3.Text = ""
|
|
ProgressBar1.Value = 0
|
|
up = 0
|
|
MsgBox("La dicté: " & OpenFileDialog1.SafeFileName & " a bien été mis en ligne", MsgBoxStyle.Information)
|
|
ListBox3.Items.Clear()
|
|
Dim fwr2 As FtpWebRequest
|
|
fwr2 = FtpWebRequest.Create(ipserver & "/" & "Utilisateur" & "/" & utilisateurnom & "/" & "Dictée" & "/")
|
|
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
|
|
|
|
ListBox3.Items.Add(str2)
|
|
|
|
|
|
str2 = sr2.ReadLine()
|
|
|
|
End While
|
|
|
|
sr2.Close()
|
|
ftp()
|
|
End Sub
|
|
|
|
Private Sub LireLaDisctéSelectionéToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles LireLaDisctéSelectionéToolStripMenuItem.Click
|
|
If ListBox1.SelectedItem = "" Then
|
|
MsgBox("Merci de sélectionner une dictée", MsgBoxStyle.Exclamation)
|
|
Else
|
|
PictureBox4.Show()
|
|
PictureBox3.Show()
|
|
PictureBox2.Hide()
|
|
GunaMetroTrackBar1.Show()
|
|
Label1.Show()
|
|
Label2.Show()
|
|
AxWindowsMediaPlayer1.URL = ipserver & "/dicté/" & ListBox1.SelectedItem & "/" & ListBox1.SelectedItem
|
|
Timer1.Start()
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub PictureBox2_Click(sender As Object, e As EventArgs) Handles PictureBox2.Click
|
|
AxWindowsMediaPlayer1.Ctlcontrols.play()
|
|
PictureBox3.Show()
|
|
PictureBox2.Hide()
|
|
End Sub
|
|
|
|
Private Sub PictureBox3_Click(sender As Object, e As EventArgs) Handles PictureBox3.Click
|
|
AxWindowsMediaPlayer1.Ctlcontrols.pause()
|
|
PictureBox3.Hide()
|
|
PictureBox2.Show()
|
|
End Sub
|
|
|
|
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
|
|
Label2.Text = AxWindowsMediaPlayer1.currentMedia.durationString
|
|
Label1.Text = AxWindowsMediaPlayer1.Ctlcontrols.currentPositionString
|
|
If AxWindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsPlaying Or AxWindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsPaused Then
|
|
GunaMetroTrackBar1.Maximum = AxWindowsMediaPlayer1.currentMedia.duration + 1
|
|
GunaMetroTrackBar1.Value = AxWindowsMediaPlayer1.Ctlcontrols.currentPosition
|
|
Else
|
|
GunaMetroTrackBar1.Value = 0
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub AxWindowsMediaPlayer1_PlayStateChange(sender As Object, e As _WMPOCXEvents_PlayStateChangeEvent) Handles AxWindowsMediaPlayer1.PlayStateChange
|
|
If AxWindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsMediaEnded Or AxWindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsStopped Then
|
|
PictureBox4.Hide()
|
|
PictureBox3.Hide()
|
|
PictureBox2.Hide()
|
|
GunaMetroTrackBar1.Hide()
|
|
Label1.Hide()
|
|
Label2.Hide()
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub PictureBox4_Click(sender As Object, e As EventArgs) Handles PictureBox4.Click
|
|
AxWindowsMediaPlayer1.Ctlcontrols.stop()
|
|
End Sub
|
|
|
|
Private Sub téléchargerfr_DownloadProgressChanged(sender As Object, e As DownloadProgressChangedEventArgs) Handles téléchargerfr.DownloadProgressChanged
|
|
ProgressBar1.Value = e.ProgressPercentage
|
|
Label3.Text = e.ProgressPercentage & "%"
|
|
End Sub
|
|
|
|
Private Sub LireLaDictéSelectionéToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles LireLaDictéSelectionéToolStripMenuItem.Click
|
|
If ListBox2.SelectedItem = "" Then
|
|
MsgBox("Merci de sélectionner une dictée", MsgBoxStyle.Exclamation)
|
|
Else
|
|
PictureBox4.Show()
|
|
PictureBox3.Show()
|
|
PictureBox2.Hide()
|
|
GunaMetroTrackBar1.Show()
|
|
Label1.Show()
|
|
Label2.Show()
|
|
AxWindowsMediaPlayer1.URL = discté & ListBox2.SelectedItem
|
|
Timer1.Start()
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub SupprimerLaDictéSelectionéToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SupprimerLaDictéSelectionéToolStripMenuItem.Click
|
|
If ListBox2.SelectedItem = "" Then
|
|
MsgBox("Merci de sélectionner une dictée", MsgBoxStyle.Exclamation)
|
|
Else
|
|
File.Delete(discté & ListBox2.SelectedItem)
|
|
MsgBox("La dictée: " & ListBox2.SelectedItem & " a bien été supprimer", MsgBoxStyle.Information)
|
|
Form21.ComboBox1.Items.Remove(ListBox2.SelectedItem)
|
|
ListBox2.Items.Remove(ListBox2.SelectedItem)
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub SupprimerLaDictéDuStoreToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SupprimerLaDictéDuStoreToolStripMenuItem.Click
|
|
If ListBox3.SelectedItem = "" Then
|
|
MsgBox("Merci de sélectionner une dictée", MsgBoxStyle.Exclamation)
|
|
Else
|
|
Dim ftreq As FtpWebRequest = FtpWebRequest.Create(ipserver & "/Dicté/" & ListBox3.SelectedItem & "/" & ListBox3.SelectedItem)
|
|
ftreq.Method = WebRequestMethods.Ftp.DeleteFile
|
|
ftreq.Credentials = New NetworkCredential("yoannsafe", passftp)
|
|
Dim ftpresp As FtpWebResponse = ftreq.GetResponse
|
|
|
|
Dim ftreq2 As FtpWebRequest = FtpWebRequest.Create(ipserver & "/Dicté/" & ListBox3.SelectedItem & "/publier.txt")
|
|
ftreq2.Method = WebRequestMethods.Ftp.DeleteFile
|
|
ftreq2.Credentials = New NetworkCredential("yoannsafe", passftp)
|
|
Dim ftpresp2 As FtpWebResponse = ftreq2.GetResponse
|
|
|
|
Dim ftreq3 As FtpWebRequest = FtpWebRequest.Create(ipserver & "/Dicté/" & ListBox3.SelectedItem & "/")
|
|
ftreq3.Method = WebRequestMethods.Ftp.RemoveDirectory
|
|
ftreq3.Credentials = New NetworkCredential("yoannsafe", passftp)
|
|
Dim ftpresp3 As FtpWebResponse = ftreq3.GetResponse
|
|
|
|
Dim ftreq4 As FtpWebRequest = FtpWebRequest.Create(ipserver & "/utilisateur/" & utilisateurnom & "/Dictée/" & ListBox3.SelectedItem & "/")
|
|
ftreq4.Method = WebRequestMethods.Ftp.RemoveDirectory
|
|
ftreq4.Credentials = New NetworkCredential("yoannsafe", passftp)
|
|
Dim ftpresp4 As FtpWebResponse = ftreq4.GetResponse
|
|
|
|
|
|
|
|
|
|
MsgBox("La Dicté: " & ListBox3.SelectedItem & " a bien été supprimer", MsgBoxStyle.Information)
|
|
|
|
ListBox3.Items.Clear()
|
|
Dim fwr2 As FtpWebRequest
|
|
fwr2 = FtpWebRequest.Create(ipserver & "/" & "Utilisateur" & "/" & utilisateurnom & "/" & "Dictée" & "/")
|
|
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
|
|
|
|
ListBox3.Items.Add(str2)
|
|
|
|
|
|
str2 = sr2.ReadLine()
|
|
|
|
End While
|
|
|
|
sr2.Close()
|
|
ftp()
|
|
End If
|
|
End Sub
|
|
Sub load2()
|
|
Me.Text = "Dictée store - " & utilisateurnom
|
|
My.Computer.Network.DownloadFile(ipserver & "/utilisateur/" & utilisateurnom & "/photo.png", compte & "photo.png")
|
|
PictureBox1.Image = Image.FromFile(compte & "\photo.png")
|
|
PictureBox1.SizeMode = PictureBoxSizeMode.Zoom
|
|
ftp()
|
|
End Sub
|
|
Private Sub SignalerLaDictéSelectionéToolStripMenuItem_Click_1(sender As Object, e As EventArgs) Handles SignalerLaDictéSelectionéToolStripMenuItem.Click
|
|
If ListBox1.SelectedItem = "" Then
|
|
MsgBox("Merci de sélectionner une dictée", MsgBoxStyle.Exclamation)
|
|
Else
|
|
Form151.ShowDialog()
|
|
End If
|
|
End Sub
|
|
Sub comptelect()
|
|
Dim lines1() As String = File.ReadAllLines(compteco)
|
|
utilisateurnom = lines1(0)
|
|
If Directory.Exists(dictéenligne) = True Then
|
|
Directory.Delete(dictéenligne)
|
|
Else
|
|
|
|
End If
|
|
|
|
Try
|
|
Dim maj As New WebClient
|
|
Dim vri As String = maj.DownloadString(ipsite & "/utilisateur/" & utilisateurnom & "/modo.txt")
|
|
SupprimerLaDictéeSélectionnezToolStripMenuItem.Visible = True
|
|
Catch ex As Exception
|
|
|
|
End Try
|
|
|
|
ListBox3.Items.Clear()
|
|
|
|
Dim fwr2 As FtpWebRequest
|
|
fwr2 = FtpWebRequest.Create(ipserver & "/" & "Utilisateur" & "/" & utilisateurnom & "/" & "Dictée" & "/")
|
|
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
|
|
|
|
ListBox3.Items.Add(str2)
|
|
|
|
|
|
str2 = sr2.ReadLine()
|
|
|
|
End While
|
|
|
|
sr2.Close()
|
|
|
|
Label3.Hide()
|
|
ProgressBar1.Hide()
|
|
PictureBox4.Hide()
|
|
PictureBox3.Hide()
|
|
PictureBox2.Hide()
|
|
GunaMetroTrackBar1.Hide()
|
|
Label1.Hide()
|
|
Label2.Hide()
|
|
|
|
For Each fichier As String In IO.Directory.GetFiles(discté)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
ListBox2.Items.Add(info.Name)
|
|
Next
|
|
Form21.TopMost = False
|
|
|
|
load2()
|
|
End Sub
|
|
|
|
Private Sub AcctualiserToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AcctualiserToolStripMenuItem.Click
|
|
ftp()
|
|
End Sub
|
|
|
|
Private Sub SupprimerLaDictéeSélectionnezToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SupprimerLaDictéeSélectionnezToolStripMenuItem.Click
|
|
If ListBox1.SelectedItem = "" Then
|
|
MsgBox("merci de selectionnez un dicté", MsgBoxStyle.Exclamation)
|
|
Else
|
|
Dim msg = MsgBox("Voulez-vous supprimer la dicté: " & ListBox1.SelectedItem, MsgBoxStyle.YesNo)
|
|
If msg = MsgBoxResult.Yes Then
|
|
deldictee()
|
|
Else
|
|
MsgBox("action annuler", MsgBoxStyle.Information)
|
|
End If
|
|
End If
|
|
End Sub
|
|
Sub deldictee()
|
|
My.Computer.Network.DownloadFile(ipsite & "/Dicté/" & ListBox1.SelectedItem & "/publier.txt", discté & "\publiertemps.txt")
|
|
Dim lines1() As String = File.ReadAllLines(discté & "\publiertemps.txt")
|
|
File.Delete(discté & "\publiertemps.txt")
|
|
Dim ftreq As FtpWebRequest = FtpWebRequest.Create(ipserver & "/Dicté/" & ListBox1.SelectedItem & "/" & ListBox1.SelectedItem)
|
|
ftreq.Method = WebRequestMethods.Ftp.DeleteFile
|
|
ftreq.Credentials = New NetworkCredential("yoannsafe", passftp)
|
|
Dim ftpresp As FtpWebResponse = ftreq.GetResponse
|
|
|
|
Dim ftreq2 As FtpWebRequest = FtpWebRequest.Create(ipserver & "/Dicté/" & ListBox1.SelectedItem & "/publier.txt")
|
|
ftreq2.Method = WebRequestMethods.Ftp.DeleteFile
|
|
ftreq2.Credentials = New NetworkCredential("yoannsafe", passftp)
|
|
Dim ftpresp2 As FtpWebResponse = ftreq2.GetResponse
|
|
|
|
Dim ftreq3 As FtpWebRequest = FtpWebRequest.Create(ipserver & "/Dicté/" & ListBox1.SelectedItem & "/")
|
|
ftreq3.Method = WebRequestMethods.Ftp.RemoveDirectory
|
|
ftreq3.Credentials = New NetworkCredential("yoannsafe", passftp)
|
|
Dim ftpresp3 As FtpWebResponse = ftreq3.GetResponse
|
|
|
|
Dim ftreq4 As FtpWebRequest = FtpWebRequest.Create(ipserver & "/utilisateur/" & lines1(0) & "/Dictée/" & ListBox1.SelectedItem & "/")
|
|
ftreq4.Method = WebRequestMethods.Ftp.RemoveDirectory
|
|
ftreq4.Credentials = New NetworkCredential("yoannsafe", passftp)
|
|
Dim ftpresp4 As FtpWebResponse = ftreq4.GetResponse
|
|
MsgBox("La Dicté: " & ListBox1.SelectedItem & " a bien été supprimer", MsgBoxStyle.Information)
|
|
Dim msg = MsgBox("Voulez-vous vraiment prévenir le personne que sa musique a êtê supprimer ?", MsgBoxStyle.YesNo)
|
|
If msg = MsgBoxResult.Yes Then
|
|
mailsuppr.nomfile = ListBox1.SelectedItem
|
|
mailsuppr.publier = lines1(0)
|
|
mailsuppr.typfile = "Dictée"
|
|
mailsuppr.userdladmin = utilisateurnom
|
|
mailsuppr.ShowDialog()
|
|
End If
|
|
ftp()
|
|
End Sub
|
|
|
|
Private Sub InformationSurLaDictéeSélectionneToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles InformationSurLaDictéeSélectionneToolStripMenuItem.Click
|
|
If ListBox1.SelectedItem = "" Then
|
|
MsgBox("merci de sélectionnez une dicté", MsgBoxStyle.Exclamation)
|
|
Else
|
|
My.Computer.Network.DownloadFile(ipsite & "/Dicté/" & ListBox1.SelectedItem & "/publier.txt", discté & "/publiertemps.txt")
|
|
Dim lines1() As String = File.ReadAllLines(discté & "/publiertemps.txt")
|
|
File.Delete(discté & "/publiertemps.txt")
|
|
MsgBox("Publier par: " & lines1(0), MsgBoxStyle.Information)
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub téléchargerfr2_UploadProgressChanged(sender As Object, e As UploadProgressChangedEventArgs) Handles téléchargerfr2.UploadProgressChanged
|
|
ProgressBar1.Value = e.ProgressPercentage
|
|
Label3.Text = e.ProgressPercentage & "%"
|
|
End Sub
|
|
End Class |