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

116 lines
4.9 KiB
VB.net

Imports System.Security.Cryptography
Imports System.Text
Imports System.IO
Imports System.Net.Mail
Imports System.ComponentModel
Public Class mailsuppr
Public typfile As String = ""
Public publier As String = ""
Public nomfile As String = ""
Dim addresmail As String = ""
Public userdladmin As String = ""
Dim mailup As Integer = 0
Private Sub mailsuppr_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.BackColor = Form1.BackColor
Me.ForeColor = Form1.ForeColor
ComboBox1.BackColor = BackColor
TextBox1.BackColor = BackColor
Button1.BackColor = BackColor
TextBox1.ForeColor = ForeColor
ComboBox1.ForeColor = ForeColor
Text = "Envoi d'un mail a " & publier
mailup = 1
ComboBox1.SelectedItem = "Contenu a caractère sexuel"
My.Computer.Network.DownloadFile(ipsite & "utilisateur/" & publier & "/mail.txt", dosparamètres & "\mailtemps.txt")
Dim lines1() As String = File.ReadAllLines(dosparamètres & "\mailtemps.txt")
File.Delete(dosparamètres & "\mailtemps.txt")
Dim Resultatbytes() As Byte = Convert.FromBase64String(lines1(0))
Dim keyBytes() As Byte = Encoding.UTF8.GetBytes("Jj@msms7")
Dim Crypto As New DESCryptoServiceProvider()
Crypto.Key = keyBytes
Crypto.IV = keyBytes
Dim Icrypto As ICryptoTransform = Crypto.CreateDecryptor()
Dim donné() As Byte = Icrypto.TransformFinalBlock(Resultatbytes, 0, Resultatbytes.Length)
addresmail = Encoding.UTF8.GetString(donné)
End Sub
Private Sub ComboBox1_SelectedValueChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedValueChanged
If ComboBox1.SelectedItem = "Autre" Then
Label1.Text = "explication: (obligatoire)"
Label1.Show()
TextBox1.Show()
Else
Label1.Hide()
TextBox1.Hide()
End If
End Sub
Sub mail1()
Dim MyMailMessage As New MailMessage()
Dim SMTPServer As New SmtpClient("mail48.lwspanel.com")
Dim mail = addresmail
Dim message = "Bonjour, " & publier & vbNewLine & vbNewLine & "Vôtre " & typfile & ": " & nomfile & " a êtê supprimer par le modérateur: " & userdladmin & " Pour cause de: " & TextBox1.Text
MyMailMessage.From = New MailAddress("noreply@lecteur-media.fr")
MyMailMessage.To.Add(mail)
MyMailMessage.Subject = ("Vôtre " & typfile & ": " & nomfile & " a êtê supprimer")
MyMailMessage.Body = (message)
SMTPServer.Port = ("587") 'Port
SMTPServer.Credentials = New System.Net.NetworkCredential("noreply@lecteur-media.fr", "pC1*zzU9-qtZjdT")
SMTPServer.EnableSsl = True
SMTPServer.Send(MyMailMessage)
MsgBox("Le mail d'information de surrpission a bien êtê envoyer a " & publier, MsgBoxStyle.Information)
mailup = 0
Close()
End Sub
Sub mail2()
Dim MyMailMessage As New MailMessage()
Dim SMTPServer As New SmtpClient("mail48.lwspanel.com")
Dim mail = addresmail
Dim message = "Bonjour, " & publier & vbNewLine & vbNewLine & "Vôtre " & typfile & ": " & nomfile & " a êtê supprimer par le modérateur: " & userdladmin & " Pour cause de: " & ComboBox1.SelectedItem
MyMailMessage.From = New MailAddress("noreply@lecteur-media.fr")
MyMailMessage.To.Add(mail)
MyMailMessage.Subject = ("Vôtre " & typfile & ": " & nomfile & " a êtê supprimer")
MyMailMessage.Body = (message)
SMTPServer.Port = ("587") 'Port
SMTPServer.Credentials = New System.Net.NetworkCredential("noreply@lecteur-media.fr", "pC1*zzU9-qtZjdT")
SMTPServer.EnableSsl = True
SMTPServer.Send(MyMailMessage)
MsgBox("Le mail d'information de surrpission a bien êtê envoyer a " & publier, MsgBoxStyle.Information)
mailup = 0
Close()
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If ComboBox1.SelectedItem = "Autre" Then
If TextBox1.Text = "" Then
MsgBox("merci de justifier la suppétion", MsgBoxStyle.Exclamation)
Else
mail1()
End If
Else
mail2()
End If
End Sub
Private Sub mailsuppr_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
If mailup = 1 Then
If ComboBox1.SelectedItem = "Autre" Then
If TextBox1.Text = "" Then
e.Cancel = True
MsgBox("merci de justifier la suppétion", MsgBoxStyle.Exclamation)
Else
mail1()
End If
Else
mail2()
End If
Else
typfile = ""
publier = ""
nomfile = ""
addresmail = ""
userdladmin = ""
End If
End Sub
End Class