Imports System.ComponentModel Imports System.IO Public Class modififilm2 Public urllike As String = "" Private Sub modififilm2_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing TextBox1.Clear() TextBox2.Clear() TextBox3.Clear() TextBox4.Clear() PictureBox1.Image.Dispose() OpenFileDialog1.FileName = "" End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click If TextBox1.Text = "" Then MsgBox("merci d'entrer la durré du fim", MsgBoxStyle.Exclamation) Else If TextBox2.Text = "" Then MsgBox("merci d'entrer le résalisteur du fim", MsgBoxStyle.Exclamation) Else If TextBox3.Text = "" Then MsgBox("merci d'entrer la date de sortie", MsgBoxStyle.Exclamation) Else If TextBox4.Text = "" Then MsgBox("merci d'entrer le lien de la bandeannonce", MsgBoxStyle.Exclamation) Else If TextBox5.Text = "" Then MsgBox("merci d'entrer un résumer", MsgBoxStyle.Information) Else Dim sw1 As New StreamWriter(dosparamètres & "\time.txt") sw1.WriteLine(TextBox1.Text) sw1.Close() Dim sw2 As New StreamWriter(dosparamètres & "\auteur.txt") sw2.WriteLine(TextBox2.Text) sw2.Close() Dim sw3 As New StreamWriter(dosparamètres & "\date.txt") sw3.WriteLine(TextBox3.Text) sw3.Close() Dim sw4 As New StreamWriter(dosparamètres & "\bd.txt") sw4.WriteLine(TextBox4.Text) sw4.Close() PictureBox1.Image.Save(dosparamètres & "\image.jpg") My.Computer.Network.UploadFile(dosparamètres & "\time.txt", urllike & "\time.txt") My.Computer.Network.UploadFile(dosparamètres & "\auteur.txt", urllike & "\auteur.txt") My.Computer.Network.UploadFile(dosparamètres & "\date.txt", urllike & "\date.txt") My.Computer.Network.UploadFile(dosparamètres & "\bd.txt", urllike & "\bd.txt") My.Computer.Network.UploadFile(dosparamètres & "\image.jpg", urllike & "\image.jpg") File.Delete(dosparamètres & "\time.txt") File.Delete(dosparamètres & "\auteur.txt") File.Delete(dosparamètres & "\date.txt") File.Delete(dosparamètres & "\bd.txt") File.Delete(dosparamètres & "\image.jpg") Using writer As System.IO.StreamWriter = New System.IO.StreamWriter(dosparamètres & "\resum.txt", True) Dim curLine As String = TextBox5.Text If (TextBox5.Lines.Count > 1) Then curLine = "" For Each line As String In TextBox5.Lines curLine = curLine & " " & line Next curLine = curLine.Trim() End If writer.WriteLine(curLine) End Using My.Computer.Network.UploadFile(dosparamètres & "\resum.txt", urllike & "\resum.txt") File.Delete(dosparamètres & "\resum.txt") MsgBox("Le film: " & Text.Replace("Modifier: ", "") & " a bien êtê modifier", MsgBoxStyle.Information) Close() End If End If End If End If End If End Sub Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click If OpenFileDialog1.ShowDialog = 1 Then PictureBox1.Image.Dispose() PictureBox1.Image = Image.FromFile(OpenFileDialog1.FileName) End If End Sub Private Sub modififilm2_Load(sender As Object, e As EventArgs) Handles MyBase.Load Me.BackColor = Form1.BackColor Me.ForeColor = Form1.ForeColor Button1.BackColor = BackColor Button1.ForeColor = ForeColor TextBox1.BackColor = BackColor TextBox2.BackColor = BackColor TextBox3.BackColor = BackColor TextBox4.BackColor = BackColor TextBox1.ForeColor = ForeColor TextBox2.ForeColor = ForeColor TextBox3.ForeColor = ForeColor TextBox4.ForeColor = ForeColor TextBox5.ForeColor = ForeColor TextBox5.BackColor = BackColor End Sub End Class