Files
Lecteur-media/lecteur/lecteur média/Form142.vb
T
2026-06-18 14:15:48 +02:00

106 lines
5.2 KiB
VB.net

Imports System.ComponentModel
Imports System.IO
Imports System.Net
Imports System.Security.Cryptography
Imports System.Text
Public Class Form142
Private Sub Form142_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim lines1a() As String = File.ReadAllLines(théme)
If lines1a(0) = 2 Then
Me.BackColor = Color.FromArgb(64, 64, 64)
Button1.BackColor = Color.FromArgb(64, 64, 64)
Button1.ForeColor = Color.White
Label2.ForeColor = Color.White
ComboBox2.BackColor = Color.FromArgb(64, 64, 64)
ComboBox2.ForeColor = Color.White
TextBox2.BackColor = Form1.BackColor
TextBox2.ForeColor = Form1.ForeColor
ElseIf lines1a(0) = 3 Then
Me.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
Button1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
Button1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
Label2.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
ComboBox2.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
ComboBox2.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
TextBox2.BackColor = Form1.BackColor
TextBox2.ForeColor = Form1.ForeColor
Else
End If
ComboBox2.SelectedItem = "@gmail.com"
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If TextBox2.Text.Contains("@") Then
MsgBox("Merci entre le début de votre adresse mail", MsgBoxStyle.Information)
Else
Dim texteEnBytes2() As Byte = Encoding.UTF8.GetBytes(TextBox2.Text & ComboBox2.Text)
Dim keyBytes2() As Byte = Encoding.UTF8.GetBytes("Jj@msms7")
Dim Crypto2 As New DESCryptoServiceProvider()
Crypto2.Key = keyBytes2
Crypto2.IV = keyBytes2
Dim Icrypto2 As ICryptoTransform = Crypto2.CreateEncryptor
Dim Resultatbytes2() As Byte = Icrypto2.TransformFinalBlock(texteEnBytes2, 0, texteEnBytes2.Length)
Dim mailcrypte = Convert.ToBase64String(Resultatbytes2)
Dim t2 = cozip & "mail.txt"
Dim sw7 As New StreamWriter(t2)
sw7.WriteLine(mailcrypte)
sw7.Close()
Try
Dim maj As New WebClient
Dim vri As String = maj.DownloadString(ipsite & "/newletter/" & Form3.Label21.Text & ".txt")
Dim sw1 As New StreamWriter(dosparamètres & "\" & Form3.Label21.Text & ".txt")
sw1.WriteLine(mailcrypte)
sw1.Close()
My.Computer.Network.UploadFile(cozip & "mail.txt", ipserver & "utilisateur/" & Form3.Label21.Text & "/mail.txt")
My.Computer.Network.UploadFile(dosparamètres & "\" & Form3.Label21.Text & ".txt", ipserver & "/newletter/" & Form3.Label21.Text & ".txt")
File.Delete(cozip & "mail.txt")
File.Delete(dosparamètres & "\" & Form3.Label21.Text & ".txt")
MsgBox("Le mail a bien été modifier", MsgBoxStyle.Information)
Close()
Catch ex As Exception
Try
My.Computer.Network.UploadFile(cozip & "mail.txt", ipserver & "utilisateur/" & Form3.Label21.Text & "/mail.txt")
File.Delete(cozip & "mail.txt")
MsgBox("Le mail a bien été modifier", MsgBoxStyle.Information)
Close()
Catch ex1 As Exception
Timer1.Start()
End Try
End Try
End If
End Sub
Private Sub Form142_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
TextBox2.Clear()
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Timer1.Stop()
Try
Dim maj As New WebClient
Dim vri As String = maj.DownloadString(ipsite & "/newletter/" & Form3.Label21.Text & ".txt")
My.Computer.Network.UploadFile(cozip & "mail.txt", ipserver & "utilisateur/" & Form3.Label21.Text & "/mail.txt")
My.Computer.Network.UploadFile(dosparamètres & "\" & Form3.Label21.Text & ".txt", ipserver & "/newletter/" & Form3.Label21.Text & ".txt")
File.Delete(cozip & "mail.txt")
File.Delete(dosparamètres & "\" & Form3.Label21.Text & ".txt")
MsgBox("Le mail a bien été modifier", MsgBoxStyle.Information)
Close()
Catch ex As Exception
Try
My.Computer.Network.UploadFile(cozip & "mail.txt", ipserver & "utilisateur/" & Form3.Label21.Text & "/mail.txt")
File.Delete(cozip & "mail.txt")
MsgBox("Le mail a bien été modifier", MsgBoxStyle.Information)
Close()
Catch ex1 As Exception
Timer1.Start()
End Try
End Try
End Sub
End Class