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

129 lines
4.6 KiB
VB.net

Imports System.IO
Imports System.Net
Public Class fermature
Private Sub fermature_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Form1.NotifyIcon1.Visible = False
Form1.NotifyIcon2.Visible = False
Dim lines428() As String = File.ReadAllLines(compteco)
Dim lines2() As String = File.ReadAllLines(comtpeco2)
Dim tcon2 = lines428(0)
If misdlok = 1 Then
Dim dw9 As New StreamWriter(misajours & "appli.txt")
dw9.WriteLine(My.Application.Info.DirectoryPath)
dw9.Close()
Dim dw8 As New StreamWriter(lançer)
dw8.WriteLine(0)
dw8.Close()
Form1.NotifyIcon3.Visible = False
Form1.NotifyIcon1.Visible = False
Dim lines7() As String = File.ReadAllLines(dosparamètres & "\widgets\" & "lançer.txt")
If lines7(0) = 1 Then
Form72.killProcess("widgets.exe")
Else
End If
Dim dw18 As New StreamWriter(dosparamètres & "\widgets\" & "lançer.txt")
dw18.WriteLine(0)
dw18.Close()
Try
Process.Start(misajours & "lecteur média update.exe")
End
Catch ex As Exception
Timer3.Start()
End Try
Else
Try
If My.Computer.Network.Ping("www.google.fr") Then
Dim maj As New WebClient
Dim vri As String = maj.DownloadString("http://lecteur2.lecteur-media.fr/lecteur/server%20temps.txt")
If lines2(0) = 0 Then
End
ElseIf vri = 1 Then
End
Else
Try
My.Computer.Network.DownloadFile(ipsite & "utilisateur/" & tcon2 & "/setting.txt", cozip & "/setting.txt")
hst()
Catch ex As Exception
Timer1.Start()
End Try
End If
Else
End
End If
Catch ex As Exception
End
End Try
End If
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Timer1.Stop()
Dim lines428() As String = File.ReadAllLines(compteco)
Dim lines2() As String = File.ReadAllLines(comtpeco2)
Dim tcon2 = lines428(0)
Try
My.Computer.Network.DownloadFile(ipsite & "utilisateur/" & tcon2 & "/setting.txt", cozip & "/setting.txt")
hst()
Catch ex As Exception
Timer1.Start()
End Try
End Sub
Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
End
End Sub
Sub hst()
Dim lines1() As String = File.ReadAllLines(cozip & "setting.txt")
Dim lines428() As String = File.ReadAllLines(compteco)
Dim lines2() As String = File.ReadAllLines(comtpeco2)
Dim tcon2 = lines428(0)
If lines1(1) = 1 Then
Try
My.Computer.Network.UploadFile(historique, ipserver & "utilisateur/" & tcon2 & "/historique.txt")
For Each fichier As String In IO.Directory.GetFiles(cozip)
Dim info As New IO.FileInfo(fichier)
File.Delete(fichier)
Next
End
Catch ex As Exception
Timer4.Start()
End Try
Else
For Each fichier As String In IO.Directory.GetFiles(cozip)
Dim info As New IO.FileInfo(fichier)
File.Delete(fichier)
Next
End
End If
End Sub
Private Sub Timer4_Tick(sender As Object, e As EventArgs) Handles Timer4.Tick
Timer4.Stop()
Dim lines428() As String = File.ReadAllLines(compteco)
Dim lines2() As String = File.ReadAllLines(comtpeco2)
Dim tcon2 = lines428(0)
Try
My.Computer.Network.UploadFile(historique, ipserver & "utilisateur/" & tcon2 & "/historique.txt")
For Each fichier As String In IO.Directory.GetFiles(cozip)
Dim info As New IO.FileInfo(fichier)
File.Delete(fichier)
Next
End
Catch ex As Exception
Timer4.Start()
End Try
End Sub
Private Sub Timer3_Tick(sender As Object, e As EventArgs) Handles Timer3.Tick
Timer3.Stop()
Try
Process.Start(misajours & "lecteur média update.exe")
End
Catch ex As Exception
Timer3.Start()
End Try
End Sub
End Class