Files
2026-06-18 14:15:48 +02:00

100 lines
5.1 KiB
VB.net

Imports System.IO
Imports System.Security.Cryptography
Imports System.Text
Public Class Form23
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If TextBox1.Text = "" Then
MsgBox("Merci d'entrer un mail", MsgBoxStyle.Exclamation)
Else
If TextBox1.Text.Contains("@") Then
If TextBox1.Text.Contains(".") Then
If TextBox2.Text = "" Then
MsgBox("Merci d'entrer un mot de passe", MsgBoxStyle.Exclamation)
Else
If TextBox3.Text = "" Then
MsgBox("Confirmer votre mot de passe", MsgBoxStyle.Exclamation)
Else
If TextBox2.Text = TextBox3.Text Then
acctive()
Else
MsgBox("Les mots de passe ne correspondent pas", MsgBoxStyle.Exclamation)
End If
End If
End If
Else
MsgBox("Merci d'entrer un mail", MsgBoxStyle.Exclamation)
End If
Else
MsgBox("Merci d'entrer un mail", MsgBoxStyle.Exclamation)
End If
End If
End Sub
Private Sub Form23_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim lines1() As String = File.ReadAllLines(théme)
If lines1(0) = 2 Then
Me.BackColor = Color.FromArgb(64, 64, 64)
TextBox1.BackColor = Color.FromArgb(64, 64, 64)
TextBox2.BackColor = Color.FromArgb(64, 64, 64)
TextBox3.BackColor = Color.FromArgb(64, 64, 64)
Button1.BackColor = Color.FromArgb(64, 64, 64)
TextBox1.ForeColor = Color.White
TextBox2.ForeColor = Color.White
TextBox3.ForeColor = Color.White
Button1.ForeColor = Color.White
Label1.ForeColor = Color.White
Label2.ForeColor = Color.White
Label3.ForeColor = Color.White
ElseIf lines1(0) = 3 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)
TextBox2.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
TextBox3.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)
TextBox2.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
TextBox3.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)
Label3.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
End If
End Sub
Sub acctive()
Dim texteEnBytes() As Byte = Encoding.UTF8.GetBytes(TextBox2.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 texteEnBytes2() As Byte = Encoding.UTF8.GetBytes(TextBox1.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 mailcypt = Convert.ToBase64String(Resultatbytes2)
Dim sw1 As New StreamWriter(passcontroleparantal)
sw1.WriteLine(passecrypt)
sw1.Close()
Dim sw2 As New StreamWriter(mailcontroleparantal)
sw2.WriteLine(mailcypt)
sw2.Close()
Dim sw3 As New StreamWriter(doscontroleparantal & "active.txt")
sw3.WriteLine(0)
sw3.Close()
Form3.Button43.Show()
Form3.Button42.Text = "Désactiver"
Visible = False
Form22.ShowDialog()
End Sub
End Class