305 lines
13 KiB
VB.net
305 lines
13 KiB
VB.net
Imports System.IO
|
|
Imports System.Net
|
|
Imports System.Net.Mail
|
|
Imports System.Security.Cryptography
|
|
Imports System.Text
|
|
|
|
Public Class Form17
|
|
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
|
langfr1()
|
|
End Sub
|
|
Sub langfr1()
|
|
Try
|
|
If My.Computer.Network.Ping("www.Google.com") Then
|
|
langfr2()
|
|
End If
|
|
Catch ex As Exception
|
|
MsgBox("Vous n’êtes actuellement pas connecté à Internet", MsgBoxStyle.Information)
|
|
Me.Close()
|
|
End Try
|
|
End Sub
|
|
Sub langfr2()
|
|
Dim lines1b() As String = File.ReadAllLines(comtpeco2)
|
|
If lines1b(0) = 1 Then
|
|
If tbfilm.Text = "" Then
|
|
MsgBox("Vous deviez remplir tous les casses", MsgBoxStyle.Critical)
|
|
Exit Sub
|
|
Else
|
|
Dim bvr As String = ""
|
|
If beta = 0 Then
|
|
bvr = "version: officiel " & vr
|
|
Else
|
|
bvr = "version: Béta " & vr
|
|
End If
|
|
|
|
Try
|
|
Dim maj As New WebClient
|
|
Dim vri As String = maj.DownloadString("http://lecteur2.lecteur-media.fr/lecteur/passmail.txt")
|
|
Dim nom = tbnom.Text
|
|
Dim mail = tbmail.Text
|
|
Dim film = tbfilm.Text
|
|
|
|
Dim Message As String = "compte lecteur média de: " & nom & vbNewLine & "mail: " & mail & vbNewLine & "film: " & film & vbNewLine & bvr
|
|
|
|
Dim MyMailMessage As New MailMessage()
|
|
Dim SMTPServer As New SmtpClient("mail48.lwspanel.com")
|
|
|
|
MyMailMessage.From = New MailAddress("noreply@lecteur-media.fr")
|
|
MyMailMessage.To.Add("contact@lecteur-media.fr")
|
|
MyMailMessage.Subject = ("film à ajouter")
|
|
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("Le message a été envoyé", MsgBoxStyle.Information)
|
|
tbfilm.Text = ""
|
|
tbnom.Text = ""
|
|
tbprenom.Text = ""
|
|
tbmail.Text = ""
|
|
Me.Close()
|
|
Exit Sub
|
|
Catch ex As Exception
|
|
Timer2.Start()
|
|
End Try
|
|
End If
|
|
|
|
Else
|
|
If tbnom.Text = "" Or tbprenom.Text = "" Or tbmail.Text = "" Or tbfilm.Text = "" Then
|
|
MsgBox("Vous deviez remplir tous les casses", MsgBoxStyle.Critical)
|
|
Exit Sub
|
|
End If
|
|
|
|
Dim bvr As String = ""
|
|
If beta = 0 Then
|
|
bvr = "version: officiel " & vr
|
|
Else
|
|
bvr = "version: Béta " & vr
|
|
End If
|
|
|
|
Try
|
|
Dim maj As New WebClient
|
|
Dim vri As String = maj.DownloadString("http://lecteur2.lecteur-media.fr/lecteur/passmail.txt")
|
|
Dim nom = tbnom.Text
|
|
Dim prenom = tbprenom.Text
|
|
Dim mail = tbmail.Text
|
|
Dim film = tbfilm.Text
|
|
|
|
Dim Message As String = "nom: " & nom & vbNewLine & "prénom: " & prenom & vbNewLine & "mail: " & mail & vbNewLine & "film: " & film & vbNewLine & bvr
|
|
|
|
Dim MyMailMessage As New MailMessage()
|
|
Dim SMTPServer As New SmtpClient("mail48.lwspanel.com")
|
|
|
|
MyMailMessage.From = New MailAddress("noreply@lecteur-media.fr")
|
|
MyMailMessage.To.Add("contact@lecteur-media.fr")
|
|
MyMailMessage.Subject = ("film à ajouter")
|
|
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("Le message a été envoyé", MsgBoxStyle.Information)
|
|
tbfilm.Text = ""
|
|
tbnom.Text = ""
|
|
tbprenom.Text = ""
|
|
tbmail.Text = ""
|
|
Me.Close()
|
|
Catch ex As Exception
|
|
Timer1.Start()
|
|
End Try
|
|
End If
|
|
|
|
End Sub
|
|
|
|
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
|
|
Timer1.Stop()
|
|
Try
|
|
If tbnom.Text = "" Or tbprenom.Text = "" Or tbmail.Text = "" Or tbfilm.Text = "" Then
|
|
MsgBox("Vous deviez remplir tous les casses", MsgBoxStyle.Critical)
|
|
Exit Sub
|
|
End If
|
|
Dim maj As New WebClient
|
|
Dim vri As String = maj.DownloadString("http://lecteur2.lecteur-media.fr/lecteur/passmail.txt")
|
|
Dim nom = tbnom.Text
|
|
Dim prenom = tbprenom.Text
|
|
Dim mail = tbmail.Text
|
|
Dim film = tbfilm.Text
|
|
|
|
Dim Message As String = "nom: " & nom & vbNewLine & "prénom: " & prenom & vbNewLine & "mail: " & mail & vbNewLine & "film: " & film
|
|
|
|
Dim MyMailMessage As New MailMessage()
|
|
Dim SMTPServer As New SmtpClient("mail48.lwspanel.com")
|
|
|
|
MyMailMessage.From = New MailAddress("noreply@lecteur-media.fr")
|
|
MyMailMessage.To.Add("contact@lecteur-media.fr")
|
|
MyMailMessage.Subject = ("film à ajouter")
|
|
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("Le message a été envoyé", MsgBoxStyle.Information)
|
|
tbfilm.Text = ""
|
|
tbnom.Text = ""
|
|
tbprenom.Text = ""
|
|
tbmail.Text = ""
|
|
Me.Close()
|
|
Catch ex As Exception
|
|
Timer1.Start()
|
|
End Try
|
|
End Sub
|
|
|
|
Private Sub Form17_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)
|
|
Label1.ForeColor = Color.White
|
|
Button1.BackColor = Color.FromArgb(64, 64, 64)
|
|
Button1.ForeColor = Color.White
|
|
Label2.ForeColor = Color.White
|
|
Label3.ForeColor = Color.White
|
|
Label4.ForeColor = Color.White
|
|
Label5.ForeColor = Color.White
|
|
tbnom.BackColor = Color.FromArgb(64, 64, 64)
|
|
tbnom.ForeColor = Color.White
|
|
tbprenom.BackColor = Color.FromArgb(64, 64, 64)
|
|
tbprenom.ForeColor = Color.White
|
|
tbmail.BackColor = Color.FromArgb(64, 64, 64)
|
|
tbmail.ForeColor = Color.White
|
|
tbfilm.BackColor = Color.FromArgb(64, 64, 64)
|
|
tbfilm.ForeColor = Color.White
|
|
ElseIf lines1a(0) = 3 Then
|
|
Me.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
Label1.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
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)
|
|
Label3.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
Label4.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
Label5.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
tbnom.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
tbnom.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
tbprenom.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
tbprenom.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
tbmail.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
tbmail.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
tbfilm.BackColor = Color.FromArgb(Form1.colorbackA, Form1.colorbackR, Form1.colorbackG, Form1.colorbackB)
|
|
tbfilm.ForeColor = Color.FromArgb(Form1.themeforecoloA, Form1.themeforecoloR, Form1.themeforecoloG, Form1.themeforecoloB)
|
|
Else
|
|
|
|
End If
|
|
|
|
Dim lines1b() As String = File.ReadAllLines(comtpeco2)
|
|
Dim lines1c() As String = File.ReadAllLines(compteco)
|
|
If lines1b(0) = 1 Then
|
|
Try
|
|
If My.Computer.Network.Ping("www.google.com") = True Then
|
|
|
|
Label1.Text = "Compte de: "
|
|
tbnom.ReadOnly = True
|
|
tbmail.ReadOnly = True
|
|
tbnom.Text = lines1c(0)
|
|
Label2.Hide()
|
|
tbprenom.Hide()
|
|
dlcozip()
|
|
Else
|
|
|
|
End If
|
|
Catch ex As Exception
|
|
|
|
End Try
|
|
|
|
Else
|
|
|
|
End If
|
|
|
|
|
|
End Sub
|
|
Sub dlcozip()
|
|
Try
|
|
My.Computer.Network.DownloadFile(ipsite & "utilisateur/" & tbnom.Text & "/mail.txt", cozip & "mail.txt")
|
|
dlcozip2()
|
|
Catch ex As Exception
|
|
Timer3.Start()
|
|
End Try
|
|
End Sub
|
|
Sub dlcozip2()
|
|
Dim lines1() As String = File.ReadAllLines(cozip & "mail.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)
|
|
Dim maildcrypt = Encoding.UTF8.GetString(donné)
|
|
tbmail.Text = maildcrypt
|
|
For Each fichier As String In IO.Directory.GetFiles(cozip)
|
|
Dim info As New IO.FileInfo(fichier)
|
|
File.Delete(fichier)
|
|
Next
|
|
End Sub
|
|
Private Sub Timer3_Tick(sender As Object, e As EventArgs) Handles Timer3.Tick
|
|
Timer3.Stop()
|
|
Try
|
|
My.Computer.Network.DownloadFile(ipsite & "utilisateur/" & tbnom.Text & "/mail.txt", cozip & "mail.txt")
|
|
dlcozip2()
|
|
Catch ex As Exception
|
|
Timer3.Start()
|
|
End Try
|
|
|
|
End Sub
|
|
|
|
Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
|
|
Dim bvr As String = ""
|
|
If beta = 0 Then
|
|
bvr = "version: officiel " & vr
|
|
Else
|
|
bvr = "version: Béta " & vr
|
|
End If
|
|
Timer2.Stop()
|
|
Try
|
|
Dim maj As New WebClient
|
|
Dim vri As String = maj.DownloadString("http://lecteur2.lecteur-media.fr/lecteur/passmail.txt")
|
|
Dim nom = tbnom.Text
|
|
Dim mail = tbmail.Text
|
|
Dim film = tbfilm.Text
|
|
|
|
Dim Message As String = "compte lecteur média de: " & nom & vbNewLine & "mail: " & mail & vbNewLine & "film: " & film & vbNewLine & bvr
|
|
|
|
Dim MyMailMessage As New MailMessage()
|
|
Dim SMTPServer As New SmtpClient("mail48.lwspanel.com")
|
|
|
|
MyMailMessage.From = New MailAddress("noreply@lecteur-media.fr")
|
|
MyMailMessage.To.Add("contact@lecteur-media.fr")
|
|
MyMailMessage.Subject = ("film à ajouter")
|
|
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("Le message a été envoyé", MsgBoxStyle.Information)
|
|
tbfilm.Text = ""
|
|
tbnom.Text = ""
|
|
tbprenom.Text = ""
|
|
tbmail.Text = ""
|
|
Me.Close()
|
|
Exit Sub
|
|
Catch ex As Exception
|
|
Timer2.Start()
|
|
End Try
|
|
End Sub
|
|
End Class |