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

323 lines
12 KiB
VB.net

Imports System.ComponentModel
Imports System.IO
Imports System.Net
Public Class Form4
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
If File.Exists(repertoire & "lançer.txt") = True Then
Else
Dim sw1 As New StreamWriter(repertoire & "lançer.txt")
sw1.WriteLine(0)
sw1.Close()
End If
ProgressBar1.Increment(1)
If ProgressBar1.Value = 100 Then
Timer1.Stop()
Form197.Show()
End If
End Sub
Private Sub Form4_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If vrportable = 1 Then
If Directory.Exists(Application.StartupPath & "/lecteur média/") = True Then
Else
Directory.CreateDirectory((Application.StartupPath & "/lecteur média/"))
Directory.CreateDirectory((Application.StartupPath & "/lecteur média backup/"))
End If
If File.Exists(Application.StartupPath & "\désinstallateur lecteur média.exe") = True Then
File.Delete(Application.StartupPath & "\désinstallateur lecteur média.exe")
End If
If File.Exists(Application.StartupPath & "\widgets.exe") = True Then
File.Delete(Application.StartupPath & "\widgets.exe")
End If
If File.Exists(Application.StartupPath & "\widget restart.exe") = True Then
File.Delete(Application.StartupPath & "\widget restart.exe")
End If
Else
End If
If Directory.Exists(Application.StartupPath & "/lecteur média/") = True Then
repertoire = Application.StartupPath & "/lecteur média/"
repertoireavis = Application.StartupPath & "/lecteur média/"
repertoirebacup = Application.StartupPath & "/lecteur média backup/"
configbackup = repertoirebacup & "\configuration\"
dossérie = repertoire & "\Séries\"
fichierconfigbackup = configbackup & "\configuration.txt"
utilitairetemps = configbackup & "\utilitaire.txt"
lastedbackup = configbackup & "\lasted backup.txt"
mesbacup = repertoirebacup & "\mes backup\"
settings1 = repertoire & "settings1.txt"
settings2 = repertoire & "settings2.txt"
settings3 = repertoire & "settings3.txt"
notification = repertoire & "notification.txt"
théme = repertoire & "théme.txt"
historique = repertoire & "historique.txt"
lançer = repertoire & "lançer.txt"
film = repertoire & "\film\"
misajours = repertoireavis & "\mis a jours\"
Favoris1 = repertoire & "\Favoris\"
Favoris2 = repertoire & "favoris.txt"
setting = film & "setting.txt"
settings4 = film & "setting 2.txt"
settings5 = film & "setting 3.txt"
musique = repertoire & "\musique\"
musiquepar = musique & "paraméttre.txt"
startpage = repertoire & "start page.txt"
discté = repertoire & "\dictée\"
radio = repertoire & "\radio\"
like2 = film & "\like\"
marqueur = repertoire & "\Marqueur\"
misa = misajours & "téléchargment.txt"
dev = repertoire & "dev.txt"
portable = repertoire & "\portable\"
compte = repertoire & "\compte\"
ipserver = ""
ipsite = "http://lecteur.lecteur-media.fr:81/"
compteco = compte & "compte.txt"
comtpeco2 = compte & "connecter.txt"
localhost = compte & "localhost.txt"
settingcompte = cozip & "/setting.txt"
date1 = compte & "date.txt"
php = compte & "index.php"
dictéenligne = discté & "\en Dicté en ligne\"
dictétemp = repertoire & "dicté temp.txt"
cozip = compte & "\co\"
imgmusique = repertoire & "img.txt"
ettt = repertoire & "éditeur de texte.txt"
marqueurtemp = repertoire & "marqueur temps.txt"
couleur = repertoire & "color.txt"
dosparamètres = repertoire & "\paramètres\"
fichiermisauto = dosparamètres & "mis a jour automatique.txt"
interface1 = dosparamètres & "interface.txt"
dosentère = misajours & "\version présédante\"
exporterconfig = ""
importconfig = ""
utilitairestemp = configbackup & "\utilitaire.txt"
dosplaylist = repertoire & "\playlist\"
fichierinstall = repertoire & "\fichierinstall.txt"
playlistnom = ""
dosprofils = repertoireavis & "profils\"
profils = repertoire & "profils.txt"
nomprofils = ""
doscontroleparantal = repertoire & "\Contrôle parental\"
mailcontroleparantal = doscontroleparantal & "\mail.txt"
passcontroleparantal = doscontroleparantal & "\pass.txt"
optioncontrleparantal = doscontroleparantal & "\option.txt"
fichiermisajourdev = dosparamètres & "\canal.txt"
filmhc = film & "film.txt"
dostheme = repertoire & "\Théme\"
themeselect = dostheme & "\Théme select.txt"
dosier = dosparamètres & "/temps2/"
tempup = dosier & "\temp up\"
End If
If Directory.Exists(repertoire) = False Then
Directory.CreateDirectory(repertoire)
End If
If Directory.Exists(dosprofils) = False Then
Directory.CreateDirectory(dosprofils)
nomprofilsdef = 1
End If
If Directory.Exists(repertoirebacup) = False Then
Directory.CreateDirectory(repertoirebacup)
End If
If File.Exists(repertoire & "théme.txt") = True Then
Else
Dim sw1 As New StreamWriter(repertoire & "théme.txt")
sw1.WriteLine(1)
sw1.Close()
End If
Dim lines1a() As String = File.ReadAllLines(repertoire & "théme.txt")
If lines1a(0) = 2 Then
Me.BackColor = Color.FromArgb(64, 64, 64)
PictureBox1.BackColor = Color.FromArgb(64, 64, 64)
PictureBox2.BackColor = Color.FromArgb(64, 64, 64)
ElseIf lines1a(0) = 3 Then
Dim lines1b() As String = File.ReadAllLines(themeselect)
Dim lines1c() As String = File.ReadAllLines(dostheme & "\" & lines1b(0) & "\colorplans.txt")
Dim A As String = lines1c(0)
Dim R1 As String = lines1c(1)
Dim G As String = lines1c(2)
Dim B As String = lines1c(3)
Me.BackColor = Color.FromArgb(A, R1, G, B)
End If
If File.Exists(repertoire & "profils.txt") = True Then
Else
Dim sw1 As New StreamWriter(repertoire & "profils.txt")
sw1.WriteLine(0)
sw1.Close()
End If
Try
If My.Computer.Network.Ping("www.google.com") = True Then
Dim maj As New WebClient
Dim vri As String = maj.DownloadString("https://dl.dropbox.com/s/31sfek6jabojfjk/server%20temps.txt?dl=0")
If vri = 1 Then
Form1.NotifyIcon1.BalloonTipTitle = "serveur"
Form1.NotifyIcon1.BalloonTipText = "le serveur de lecteur média est indisponnible !!!"
Form1.NotifyIcon1.ShowBalloonTip(0)
servertemps = 1
Else
End If
End If
Catch ex As Exception
End Try
If Directory.Exists(repertoire) = False Then
Directory.CreateDirectory(repertoire)
End If
If File.Exists(repertoire & "lançer.txt") = True Then
Else
Dim sw1 As New StreamWriter(repertoire & "lançer.txt")
sw1.WriteLine(0)
sw1.Close()
End If
Dim ProcName As String = System.AppDomain.CurrentDomain.FriendlyName.Replace(".exe", "")
Dim r = From n In Process.GetProcesses()
Where n.ProcessName = ProcName
Select n
If (r.Count > 1) Then
lang()
End If
Try
If My.Computer.Network.Ping("www.google.fr") = True Then
startup()
Else
startup()
End If
Catch ex As Exception
startup()
End Try
End Sub
Sub lang()
fr()
End Sub
Sub fr()
MsgBox("l'application est déja en cours d'éxecution", MsgBoxStyle.Critical)
End
End Sub
Sub startup()
ProgressBar1.Hide()
Dim lines10() As String = File.ReadAllLines(repertoire & "lançer.txt")
Try
If lines10(0) = 0 Then
ElseIf lines10(0) = 1 Then
End If
If nomprofilsdef = 1 Then
Form196.ShowDialog()
Else
Timer1.Start()
End If
Catch ex As Exception
Timer1.Stop()
Form84.Show()
End Try
Me.Hide()
End Sub
Private Sub Form4_KeyDown(sender As Object, e As KeyEventArgs) Handles MyBase.KeyDown
If e.KeyData = Keys.F8 Then
Process.Start(Application.StartupPath & "\utilitaires.exe")
End
End If
End Sub
Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
If Form197.ComboBox1.SelectedItem = "" Then
Else
rezrz()
End If
End Sub
Sub rezrz()
Dim lines1() As String = File.ReadAllLines(dosprofils & "/" & Form197.ComboBox1.SelectedItem & "/default.txt")
If lines1(0) = 1 Then
nomprofils = Form197.ComboBox1.SelectedItem
Try
Dim lines1a() As String = File.ReadAllLines(théme)
If lines1a(0) = 2 Then
Me.BackColor = Color.FromArgb(64, 64, 64)
PictureBox1.BackColor = BackColor
PictureBox2.BackColor = BackColor
ElseIf lines1a(0) = 3 Then
Dim lines1b() As String = File.ReadAllLines(themeselect)
Dim lines1c() As String = File.ReadAllLines(dostheme & "\" & lines1b(0) & "\colorplans.txt")
Dim A As String = lines1c(0)
Dim R As String = lines1c(1)
Dim G As String = lines1c(2)
Dim B As String = lines1c(3)
Me.BackColor = Color.FromArgb(A, R, G, B)
BackColor = Color.FromArgb(A, R, G, B)
PictureBox1.BackColor = Color.FromArgb(A, R, G, B)
PictureBox2.BackColor = Color.FromArgb(A, R, G, B)
End If
Catch ex As Exception
End Try
Else
Try
Dim lines1a() As String = File.ReadAllLines(dosprofils & Form197.ComboBox1.SelectedItem & "\théme.txt")
If lines1a(0) = 2 Then
Me.BackColor = Color.FromArgb(64, 64, 64)
PictureBox1.BackColor = BackColor
PictureBox2.BackColor = BackColor
ElseIf lines1a(0) = 3 Then
Dim lines1b() As String = File.ReadAllLines(dosprofils & Form197.ComboBox1.SelectedItem & "\Théme\Théme select.txt")
Dim lines1c() As String = File.ReadAllLines(dosprofils & Form197.ComboBox1.SelectedItem & "\Théme\" & lines1b(0) & "\colorplans.txt")
Dim A As String = lines1c(0)
Dim R As String = lines1c(1)
Dim G As String = lines1c(2)
Dim B As String = lines1c(3)
Me.BackColor = Color.FromArgb(A, R, G, B)
PictureBox1.BackColor = Color.FromArgb(A, R, G, B)
PictureBox2.BackColor = Color.FromArgb(A, R, G, B)
End If
Catch ex As Exception
End Try
End If
End Sub
Private Sub Form4_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
Timer1.Stop()
Timer2.Stop()
End Sub
End Class