Imports System.Security.Cryptography Imports System.Text Imports System.IO Imports System.ComponentModel Imports System.Net Imports System.Net.Mail Public Class Form24 Public opt As Integer = 0 Private Sub Form24_Load(sender As Object, e As EventArgs) Handles MyBase.Load If opt = 0 Then Button1.Text = "Suivant" ElseIf opt = 1 Then Button1.Text = "Désactiver" ElseIf opt = 2 Then Button1.Text = "Afficher l'historique" End If Dim lines1() As String = File.ReadAllLines(théme) If lines1(0) = 2 Then Me.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) TextBox1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) Button1.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB) TextBox1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) Button1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) Label1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) Label2.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) LinkLabel1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) LinkLabel1.LinkColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB) End If End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim texteEnBytes() As Byte = Encoding.UTF8.GetBytes(TextBox1.Text) 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.CreateEncryptor Dim Resultatbytes() As Byte = Icrypto.TransformFinalBlock(texteEnBytes, 0, texteEnBytes.Length) Dim passecrypt = Convert.ToBase64String(Resultatbytes) Dim lines1() As String = File.ReadAllLines(passcontroleparantal) If passecrypt = lines1(0) Then If opt = 0 Then Close() Form22.ShowDialog() ElseIf opt = 1 Then Dim sw1 As New StreamWriter(passcontroleparantal) sw1.WriteLine(0) sw1.Close() Dim sw2 As New StreamWriter(mailcontroleparantal) sw2.WriteLine(0) sw2.Close() Dim sw3 As New StreamWriter(optioncontrleparantal) sw3.WriteLine(0) sw3.WriteLine(0) sw3.WriteLine(0) sw3.WriteLine(0) sw3.WriteLine(0) sw3.WriteLine(0) sw3.WriteLine(0) sw3.WriteLine(0) sw3.Close() File.Delete(doscontroleparantal & "active.txt") Form3.Button43.Hide() Form3.Button42.Text = "Activer" Form1.ComboBox1.Enabled = True Form1.Button3.Enabled = True Form8.ComboBox1.Enabled = True Form1.FilmStreamingToolStripMenuItem.Visible = True Form1.SériesStreamingToolStripMenuItem.Visible = True Form3.ChromeTabcontrol1.TabPages.Remove(Form3.TabPage18) Form12.PlaylistStoreToolStripMenuItem.Visible = True Form21.DictéToolStripMenuItem.Visible = True Form1.MusiqueStreamingToolStripMenuItem1.Visible = True Form3.ChromeTabcontrol1.TabPages.Add(Form3.TabPage18) MsgBox("Le control parental a bien été désactiverLe control parental a bien été désactiver", MsgBoxStyle.Information) Close() ElseIf opt = 2 Then Form29.ShowDialog() Close() End If Else MsgBox("Mots de passe incorrect", MsgBoxStyle.Critical) End If End Sub Private Sub Form24_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing TextBox1.Clear() End Sub Private Sub LinkLabel1_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked Try If My.Computer.Network.Ping("www.google.com") = True Then mail() Else MsgBox("Vous n’êtes actuellement pas connecté à Internet", MsgBoxStyle.Information) End If Catch ex As Exception MsgBox("Vous n’êtes actuellement pas connecté à Internet", MsgBoxStyle.Information) End Try End Sub Sub mail() Dim lines1() As String = File.ReadAllLines(mailcontroleparantal) 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) Dim maildecrypt = Encoding.UTF8.GetString(donné) Dim lines2() As String = File.ReadAllLines(passcontroleparantal) Dim Resultatbytes2() As Byte = Convert.FromBase64String(lines2(0)) 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.CreateDecryptor() Dim donné2() As Byte = Icrypto2.TransformFinalBlock(Resultatbytes2, 0, Resultatbytes2.Length) Dim passdecrypt = Encoding.UTF8.GetString(donné2) Dim maj As New WebClient Dim vri As String = maj.DownloadString("http://lecteur2.lecteur-media.fr/lecteur/passmail.txt") Dim Message As String = "Vous avez oublier le mots de passe du control parental de: " & nomprofils & vbNewLine & vbNewLine & "Le mots de passe est: " & passdecrypt Dim MyMailMessage As New MailMessage() Dim SMTPServer As New SmtpClient("mail48.lwspanel.com") MyMailMessage.From = New MailAddress("noreply@lecteur-media.fr") MyMailMessage.To.Add(maildecrypt) MyMailMessage.Subject = ("Mots de passe oublier") MyMailMessage.Body = (Message) SMTPServer.Port = ("587") 'Port SMTPServer.Credentials = New System.Net.NetworkCredential("noreply@lecteur-media.fr", vri) SMTPServer.EnableSsl = True SMTPServer.Send(MyMailMessage) 'Envoi MsgBox("Votre mot de passe a été envoyé sur votre l'adresse mail", MsgBoxStyle.Information) End Sub End Class